Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 29544f03 authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart
Browse files

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: default avatarMichał Kępień <kernel@kempniu.pl>
Acked-by: default avatarJonathan Woithe <jwoithe@just42.net>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 2451d19d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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,