[PATCH] mtd: nand: mxc_nand fix compiler warning

Alex Gershgorin alexg at meprolight.com
Wed Jun 13 03:06:50 EDT 2012


Hi Uwe,

> > >Having said that, I prefer to have
>
> > >  http://mid.gmane.org/1335171381-24869-1-git-send-email-u.kleine-koenig@pengutronix.de
> > > (and the follow-ups) applied. Casting away consts is nearly always
> > > wrong.
>
> I think this patch will solve the warnings problem only in mxc_nand driver, but this patch also creates
>  new same problems to  other drivers that use struct of_device_id.
> > > >Yeah, but IMHO they are worth to be fixed. With your patch you assume
> > > > that the data member will never be modified (and in fact it shouldn't).

No my patch only removes a compiler warning of the mxc_nand driver in current version of the kernel.
 
> > > > So the right thing is to make that assumption offical.
> > > > And for well-behaved drivers the fix is easy (i.e. spread a few consts),
> > > > and bad drivers are forced to be fixed (or introduce casts for const
> > > > that hopefully will be catched during review).

Can you imagine how many drivers will require additional patches and what should be the level of fixation?
I do not know
But in general your idea is good, only in my opinion this requires a more in-depth review.

Regards,
Alex






 



More information about the linux-mtd mailing list