diff options
author | Tim Sell <Timothy.Sell@unisys.com> | 2016-05-06 20:11:21 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 15:15:18 +0300 |
commit | 73ba8afe33e22b4bae26098add458bed3e666bc2 (patch) | |
tree | 6130b28ee882b592881b12b7b53c46e3f95a2a1c /drivers/staging/unisys | |
parent | 0fab0f4fcbc08763158529b5ff124c596aef6bf9 (diff) | |
download | linux-73ba8afe33e22b4bae26098add458bed3e666bc2.tar.xz |
staging: unisys: visorinput: handle_locking_key() simplifications
By directly returning for the error-case, a test was eliminated. Also,
the old_state variable was removed as it was not necessary, and some
redundant parens were removed.
Signed-off-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys')
-rw-r--r-- | drivers/staging/unisys/visorinput/visorinput.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/unisys/visorinput/visorinput.c b/drivers/staging/unisys/visorinput/visorinput.c index dc94261b31f9..12a3570780fc 100644 --- a/drivers/staging/unisys/visorinput/visorinput.c +++ b/drivers/staging/unisys/visorinput/visorinput.c @@ -467,18 +467,14 @@ handle_locking_key(struct input_dev *visorinput_dev, break; default: led = -1; - break; + return; } - if (led >= 0) { - int old_state = (test_bit(led, visorinput_dev->led)); - - if (old_state != desired_state) { - input_report_key(visorinput_dev, keycode, 1); - input_sync(visorinput_dev); - input_report_key(visorinput_dev, keycode, 0); - input_sync(visorinput_dev); - __change_bit(led, visorinput_dev->led); - } + if (test_bit(led, visorinput_dev->led) != desired_state) { + input_report_key(visorinput_dev, keycode, 1); + input_sync(visorinput_dev); + input_report_key(visorinput_dev, keycode, 0); + input_sync(visorinput_dev); + __change_bit(led, visorinput_dev->led); } } |