HID: sony: Default initialize all elements of the LED max_brightness array to 1
authorFrank Praznik <frank.praznik@oh.rr.com>
Wed, 30 Jul 2014 02:55:48 +0000 (19:55 -0700)
committerJiri Kosina <jkosina@suse.cz>
Wed, 30 Jul 2014 09:25:22 +0000 (11:25 +0200)
Previously only the first element of the array was initialized to 1
leading to potential incorrect max brightness values for the LEDs
on the Dualshock 3 and buzzer controllers.

Use a designated initializer to initialize the whole array to the
correct value.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c

index bb1e969..c372368 100644 (file)
@@ -1349,7 +1349,7 @@ static int sony_leds_init(struct sony_sc *sc)
        static const char * const ds4_name_str[] = { "red", "green", "blue",
                                                  "global" };
        __u8 initial_values[MAX_LEDS] = { 0 };
-       __u8 max_brightness[MAX_LEDS] = { 1 };
+       __u8 max_brightness[MAX_LEDS] = { [0 ... (MAX_LEDS - 1)] = 1 };
        __u8 use_hw_blink[MAX_LEDS] = { 0 };
 
        BUG_ON(!(sc->quirks & SONY_LED_SUPPORT));