mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 09:20:17 +00:00
platform/x86: fujitsu-laptop: decrease indentation in acpi_fujitsu_hotkey_notify()
acpi_fujitsu_hotkey_notify() is pretty deeply nested, which hurts readability. Strip off one level of indentation by returning early when the event code supplied as argument is not ACPI_FUJITSU_NOTIFY_CODE1. Signed-off-by: Michał Kępień <kernel@kempniu.pl> Acked-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
parent
5c461e8e74
commit
eb357cbaf7
@ -1044,12 +1044,21 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
|
||||
|
||||
input = fujitsu_hotkey->input;
|
||||
|
||||
if (event != ACPI_FUJITSU_NOTIFY_CODE1) {
|
||||
keycode = KEY_UNKNOWN;
|
||||
vdbg_printk(FUJLAPTOP_DBG_WARN,
|
||||
"Unsupported event [0x%x]\n", event);
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fujitsu_hotkey->rfkill_supported)
|
||||
fujitsu_hotkey->rfkill_state =
|
||||
call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
|
||||
|
||||
switch (event) {
|
||||
case ACPI_FUJITSU_NOTIFY_CODE1:
|
||||
i = 0;
|
||||
while ((irb =
|
||||
call_fext_func(FUNC_BUTTONS, 0x1, 0x0, 0x0)) != 0
|
||||
@ -1125,17 +1134,6 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
|
||||
input_sync(input);
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
keycode = KEY_UNKNOWN;
|
||||
vdbg_printk(FUJLAPTOP_DBG_WARN,
|
||||
"Unsupported event [0x%x]\n", event);
|
||||
input_report_key(input, keycode, 1);
|
||||
input_sync(input);
|
||||
input_report_key(input, keycode, 0);
|
||||
input_sync(input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialization */
|
||||
|
Loading…
x
Reference in New Issue
Block a user