Commit 57ab7dae27fae6a492ec968dc543106685adcad5

Authored by Corentin Chary
Committed by Matthew Garrett
1 parent e12e6d94db

asus-wmi: minor cleanups

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Matthew Garrett <mjg@redhat.com>

Showing 2 changed files with 18 additions and 18 deletions Side-by-side Diff

drivers/platform/x86/asus-wmi.c
... ... @@ -2,7 +2,7 @@
2 2 * Asus PC WMI hotkey driver
3 3 *
4 4 * Copyright(C) 2010 Intel Corporation.
5   - * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com>
  5 + * Copyright(C) 2010-2011 Corentin Chary <corentin.chary@gmail.com>
6 6 *
7 7 * Portions based on wistron_btns.c:
8 8 * Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
... ... @@ -87,7 +87,7 @@
87 87 #define ASUS_WMI_DEVID_CARDREADER 0x00080013
88 88  
89 89 /* Input */
90   -#define ASUS_WMI_DEVID_TOUCHPAD 0x00100011
  90 +#define ASUS_WMI_DEVID_TOUCHPAD 0x00100011
91 91 #define ASUS_WMI_DEVID_TOUCHPAD_LED 0x00100012
92 92  
93 93 /* DSTS masks */
94 94  
95 95  
96 96  
97 97  
... ... @@ -903,25 +903,25 @@
903 903  
904 904 obj = (union acpi_object *)response.pointer;
905 905  
906   - if (obj && obj->type == ACPI_TYPE_INTEGER) {
907   - code = obj->integer.value;
908   - orig_code = code;
  906 + if (!obj || obj->type != ACPI_TYPE_INTEGER)
  907 + goto exit;
909 908  
910   - if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
911   - code = NOTIFY_BRNUP_MIN;
912   - else if (code >= NOTIFY_BRNDOWN_MIN &&
913   - code <= NOTIFY_BRNDOWN_MAX)
914   - code = NOTIFY_BRNDOWN_MIN;
  909 + code = obj->integer.value;
  910 + orig_code = code;
915 911  
916   - if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
917   - if (!acpi_video_backlight_support())
918   - asus_wmi_backlight_notify(asus, orig_code);
919   - }
  912 + if (code >= NOTIFY_BRNUP_MIN && code <= NOTIFY_BRNUP_MAX)
  913 + code = NOTIFY_BRNUP_MIN;
  914 + else if (code >= NOTIFY_BRNDOWN_MIN &&
  915 + code <= NOTIFY_BRNDOWN_MAX)
  916 + code = NOTIFY_BRNDOWN_MIN;
920 917  
921   - if (!sparse_keymap_report_event(asus->inputdev, code, 1, true))
922   - pr_info("Unknown key %x pressed\n", code);
923   - }
  918 + if (code == NOTIFY_BRNUP_MIN || code == NOTIFY_BRNDOWN_MIN) {
  919 + if (!acpi_video_backlight_support())
  920 + asus_wmi_backlight_notify(asus, orig_code);
  921 + } else if (!sparse_keymap_report_event(asus->inputdev, code, 1, true))
  922 + pr_info("Unknown key %x pressed\n", code);
924 923  
  924 +exit:
925 925 kfree(obj);
926 926 }
927 927  
drivers/platform/x86/eeepc-wmi.c
... ... @@ -2,7 +2,7 @@
2 2 * Eee PC WMI hotkey driver
3 3 *
4 4 * Copyright(C) 2010 Intel Corporation.
5   - * Copyright(C) 2010 Corentin Chary <corentin.chary@gmail.com>
  5 + * Copyright(C) 2010-2011 Corentin Chary <corentin.chary@gmail.com>
6 6 *
7 7 * Portions based on wistron_btns.c:
8 8 * Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>