]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: fujitsu-laptop: simplify brightness key event generation logic
authorMichał Kępień <kernel@kempniu.pl>
Wed, 1 Mar 2017 06:42:54 +0000 (07:42 +0100)
committerDarren Hart <dvhart@infradead.org>
Wed, 15 Mar 2017 05:57:15 +0000 (22:57 -0700)
commite4dc3d930da988ae2632ca4bf8df854455ff385e
tree1ab6f2d26ef8fb675bffb2462077e506ee155424
parent89e8d48494aba320e5c581955512a74caea616ef
platform/x86: fujitsu-laptop: simplify brightness key event generation logic

Returning early when there is no brightness change allows removal of a
duplicate code block, makes the purpose of the following code clearer
and allows the condition surrounding key event generation to be removed.
Local integer variables can also be declared in a single line.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-and-tested-by: Jonathan Woithe <jwoithe@just42.net>
drivers/platform/x86/fujitsu-laptop.c