]> git.baikalelectronics.ru Git - kernel.git/commit
platform/x86: intel-vbtn: Simplify autorelease logic
authorDarren Hart (VMware) <dvhart@infradead.org>
Fri, 8 Dec 2017 22:57:54 +0000 (14:57 -0800)
committerDarren Hart (VMware) <dvhart@infradead.org>
Tue, 12 Dec 2017 00:30:51 +0000 (16:30 -0800)
commitccb6b1a895b6c4aaae952f4a053a4f92cf9967a4
tree9b7266732ce8d13c0e1b29ccea7d74f37db3d843
parent68a995b4fdf249ce1cc0d3cd4dec2c01fa465d4b
platform/x86: intel-vbtn: Simplify autorelease logic

The new notify_handler logic determining if autorelease should be used or
not is a bit awkward, and can result in more than one call to
sparse_keymap_report_event for the same event (scancode). The nesting
and long lines also made it difficult to read.

Simplify the logic by eliminating a level of nesting with a goto and
always calculate autorelease and val so we can make a single call to
sparse_keymap_report_event.

Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
Reviewed-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Tested-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Cc: AceLan Kao <acelan.kao@canonical.com>
drivers/platform/x86/intel-vbtn.c