]> granicus.if.org Git - intel_nuc_led/commitdiff
initialize variables to default values cleanup
authorNathan Wagner <nw@hydaspes.if.org>
Thu, 22 Feb 2018 20:24:45 +0000 (14:24 -0600)
committerNathan Wagner <nw@hydaspes.if.org>
Thu, 22 Feb 2018 20:24:45 +0000 (14:24 -0600)
The compiler can't tell that some variables will be initialized,
and gives a warning.  Initializing the variables prevents the
warning.

nuc_led.c

index 36cf9ce67bf723dfe9bb2e49dcfcec2ade8c4a0e..9a2cc30f048117255554394e7a0b1d29caab7a3c 100644 (file)
--- a/nuc_led.c
+++ b/nuc_led.c
@@ -227,8 +227,11 @@ static ssize_t acpi_proc_write(struct file *filp, const char __user *buff,
         int ret = 0;
         char *input, *arg;
         static int status  = 0;
-        struct led_set_state_return retval;
-        u32 led, brightness, blink_fade, color_state;
+        struct led_set_state_return retval = { 0 };
+       u32 led = NUCLED_WMI_POWER_COLOR_BLUE;
+       u32 brightness = 100;
+       u32 blink_fade = NUCLED_WMI_ALWAYS_ON;
+       u32 color_state = NUCLED_WMI_POWER_COLOR_BLUE;
 
         // Move buffer from user space to kernel space
         input = vmalloc(len);