msi-wmi: replace one-condition switch-case with if statement
authorAnisse Astier <anisse@astier.eu>
Thu, 10 Dec 2009 13:18:18 +0000 (14:18 +0100)
committerLen Brown <len.brown@intel.com>
Wed, 16 Dec 2009 17:40:54 +0000 (12:40 -0500)
Signed-off-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/platform/x86/msi-wmi.c

index d7579359a2c5861e81ce56e286d25ab09118e8ad..2c2afc1828b8fd9cfeaeb7747072e3b31e449e43 100644 (file)
@@ -243,14 +243,10 @@ static void msi_wmi_notify(u32 value, void *context)
                        }
                        key->last_pressed = cur;
 
-                       switch (key->type) {
-                       case KE_KEY:
-                               /* Brightness is served via acpi video driver */
-                               if (!backlight &&
-                                   (key->keycode == KEY_BRIGHTNESSUP ||
-                                    key->keycode == KEY_BRIGHTNESSDOWN))
-                                       break;
-
+                       if (key->type == KE_KEY &&
+                       /* Brightness is served via acpi video driver */
+                       (backlight || (key->keycode != KEY_BRIGHTNESSUP &&
+                       key->keycode != KEY_BRIGHTNESSDOWN))) {
                                dprintk("Send key: 0x%X - "
                                        "Input layer keycode: %d\n", key->code,
                                         key->keycode);
@@ -260,7 +256,6 @@ static void msi_wmi_notify(u32 value, void *context)
                                input_report_key(msi_wmi_input_dev,
                                                 key->keycode, 0);
                                input_sync(msi_wmi_input_dev);
-                               break;
                        }
                } else
                        printk(KERN_INFO "Unknown key pressed - %x\n",