From: Michał Kępień Date: Wed, 11 Jan 2017 08:59:32 +0000 (+0100) Subject: platform/x86: fujitsu-laptop: break up complex loop condition X-Git-Tag: v4.11-rc1~70^2~32 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=29544f03e52b2a6670ae1f1331033feefa216536;p=karo-tx-linux.git 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ń Acked-by: Jonathan Woithe Signed-off-by: Darren Hart --- 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,