[PATCH 6/7] msi-wmi: replace one-condition switch-case with if statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Anisse Astier <anisse@xxxxxxxxx>
---
 drivers/platform/x86/msi-wmi.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c
index d757935..2c2afc1 100644
--- a/drivers/platform/x86/msi-wmi.c
+++ b/drivers/platform/x86/msi-wmi.c
@@ -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",
-- 
1.6.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux