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

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

platform/x86: fujitsu-laptop: decrease indentation in acpi_fujitsu_bl_notify()



acpi_fujitsu_bl_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: default avatarMichał Kępień <kernel@kempniu.pl>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: default avatarJonathan Woithe <jwoithe@just42.net>
parent 1f3bc53d
Loading
Loading
Loading
Loading
+33 −31
Original line number Diff line number Diff line
@@ -795,8 +795,17 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)

	input = fujitsu_bl->input;

	switch (event) {
	case ACPI_FUJITSU_NOTIFY_CODE1:
	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;
	}

	keycode = 0;
	oldb = fujitsu_bl->brightness_level;
	get_lcd_level();
@@ -823,13 +832,6 @@ static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
		}
		keycode = KEY_BRIGHTNESSDOWN;
	}
		break;
	default:
		keycode = KEY_UNKNOWN;
		vdbg_printk(FUJLAPTOP_DBG_WARN,
			    "unsupported event [0x%x]\n", event);
		break;
	}

	if (keycode != 0) {
		input_report_key(input, keycode, 1);