]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
leds: Make default trigger fields const
authorTrent Piepho <tpiepho@freescale.com>
Mon, 13 Oct 2008 09:13:01 +0000 (10:13 +0100)
committerRichard Purdie <rpurdie@rpsys.net>
Mon, 20 Oct 2008 21:34:12 +0000 (22:34 +0100)
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, 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@freescale.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
include/linux/leds.h

index d41ccb56146ace0077cf09b2add2a5c6209a266b..d3a73f5a48c3f0514508da1395914e7846b488c5 100644 (file)
@@ -123,7 +123,7 @@ extern void ledtrig_ide_activity(void);
  */
 struct led_info {
        const char      *name;
-       char            *default_trigger;
+       const char      *default_trigger;
        int             flags;
 };
 
@@ -135,7 +135,7 @@ struct led_platform_data {
 /* For the leds-gpio driver */
 struct gpio_led {
        const char *name;
-       char *default_trigger;
+       const char *default_trigger;
        unsigned        gpio;
        u8              active_low;
 };