summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMichał Kępień <kernel@kempniu.pl>2017-01-11 09:59:32 +0100
committerDarren Hart <dvhart@linux.intel.com>2017-02-04 02:47:18 +0100
commit29544f03e52b2a6670ae1f1331033feefa216536 (patch)
treef0964c31d00ca5941cd750b29452fae15670c041 /drivers/platform
parentplatform/x86: fujitsu-laptop: move keycode processing to separate functions (diff)
downloadlinux-29544f03e52b2a6670ae1f1331033feefa216536.tar.xz
linux-29544f03e52b2a6670ae1f1331033feefa216536.zip
platform/x86: fujitsu-laptop: break up complex loop condition
The loop condition in acpi_fujitsu_hotkey_release() includes an assignment, a four-argument function call and a comparison, making it hard to read. Separate the assignment from the comparison to improve readability. 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>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index f46ef5782e04..1e54dddf51de 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -1059,11 +1059,13 @@ static void acpi_fujitsu_hotkey_release(void)
struct input_dev *input = fujitsu_hotkey->input;
int keycode, status;
- while ((status = kfifo_out_locked(&fujitsu_hotkey->fifo,
+ while (true) {
+ status = kfifo_out_locked(&fujitsu_hotkey->fifo,
(unsigned char *)&keycode,
sizeof(keycode),
- &fujitsu_hotkey->fifo_lock))
- == sizeof(keycode)) {
+ &fujitsu_hotkey->fifo_lock);
+ if (status != sizeof(keycode))
+ return;
input_report_key(input, keycode, 0);
input_sync(input);
vdbg_printk(FUJLAPTOP_DBG_TRACE,