[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080727231149.1b2508da.sfr@canb.auug.org.au>
Date: Sun, 27 Jul 2008 23:11:49 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Trent Piepho <tpiepho@...escale.com>
Cc: Grant Likely <grant.likely@...retlab.ca>,
linux-kernel@...r.kernel.org,
Anton Vorontsov <avorontsov@...mvista.com>,
Richard Purdie <rpurdie@...ys.net>,
Kumar Gala <galak@...nel.crashing.org>, linuxppc-dev@...abs.org
Subject: Re: [PATCH 1/2] leds: make the default trigger name const
Hi Trent,
On Sat, 26 Jul 2008 20:08:57 -0600 Grant Likely <grant.likely@...retlab.ca> wrote:
>
> On Fri, Jul 25, 2008 at 02:01:44PM -0700, Trent Piepho wrote:
> > The default_trigger fields of struct gpio_led and thus struct led_classdev
> > are pretty much always assigned from a string literal, which means the
> > string can't be modified. Which is fine, since there is no reason to
> > modify the string and in fact it never is.
> >
> > But they should be marked const to prevent such code from being added, to
> > prevent warnings if -Wwrite-strings is used and when assigned from a
> > constant string other than a string literal (which produces a warning under
> > current kernel compiler flags), and for general good coding practices.
> >
> > Signed-off-by: Trent Piepho <tpiepho@...escale.com>
> Acked-by: Grant Likely <grant.likely@...retlab.ca>
I would ack this as well, except I am not sure what tree this patch is
against. In the current powerpc next tree,
> > +++ b/include/linux/leds.h
> > @@ -48,7 +48,7 @@ struct led_classdev {
> >
> > struct device *dev;
> > struct list_head node; /* LED Device list */
> > - char *default_trigger; /* Trigger to use */
> > + const char *default_trigger; /* Trigger to use */
this is already const, but there is another structure slightly further
down (struct led_info) that has a non-const default_tigger.
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
http://www.canb.auug.org.au/~sfr/
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists