public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Alex Gershgorin <alexg@meprolight.com>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] mtd: nand: mxc_nand fix compiler warning
Date: Tue, 12 Jun 2012 16:24:43 +0200	[thread overview]
Message-ID: <20120612142443.GV22191@pengutronix.de> (raw)
In-Reply-To: <4875438356E7CA4A8F2145FCD3E61C0B2CD8AD3332@MEP-EXCH.meprolight.com>

On Tue, Jun 12, 2012 at 04:39:33PM +0300, Alex Gershgorin wrote:
> 
> On Tue, Jun 12, 2012 at 02:18:07PM +0300, Alex Gershgorin wrote:
> > This patch removes the following warning:
> > drivers/mtd/nand/mxc_nand.c:1246: warning: initialization discards qualifiers from pointer target type
> > drivers/mtd/nand/mxc_nand.c:1249: warning: initialization discards qualifiers from pointer target type
> > drivers/mtd/nand/mxc_nand.c:1252: warning: initialization discards qualifiers from pointer target type
> > drivers/mtd/nand/mxc_nand.c:1255: warning: initialization discards qualifiers from pointer target type
> >
> > Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
> >
> > Applies to v3.5-rc2+
> > ---
> > >Better write the "Applies to" line after the tripple dash. Then this
> > >info doesn't make it into the commit log. Instead point out the
> > >offending commit.
> 
> Sorry my mistake
> 
> > >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).
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).

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2012-06-12 14:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-12 11:18 [PATCH] mtd: nand: mxc_nand fix compiler warning Alex Gershgorin
2012-06-12 12:01 ` Uwe Kleine-König
2012-06-12 13:39   ` Alex Gershgorin
2012-06-12 14:24     ` Uwe Kleine-König [this message]
2012-06-13  7:06       ` Alex Gershgorin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120612142443.GV22191@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=alexg@meprolight.com \
    --cc=artem.bityutskiy@linux.intel.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox