Skip to content

Commit

Permalink
leds: Make default trigger fields const
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trent Piepho authored and Richard Purdie committed Oct 20, 2008
1 parent 132e930 commit 326bb8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/leds.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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;
};
Expand Down

0 comments on commit 326bb8a

Please sign in to comment.