diff options
author | Tim Sell <Timothy.Sell@unisys.com> | 2016-05-06 13:11:21 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-09 08:15:18 -0400 |
commit | 73ba8afe33e22b4bae26098add458bed3e666bc2 (patch) | |
tree | 6130b28ee882b592881b12b7b53c46e3f95a2a1c | |
parent | 0fab0f4fcbc08763158529b5ff124c596aef6bf9 (diff) |
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>
-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, | |||
467 | break; | 467 | break; |
468 | default: | 468 | default: |
469 | led = -1; | 469 | led = -1; |
470 | break; | 470 | return; |
471 | } | 471 | } |
472 | if (led >= 0) { | 472 | if (test_bit(led, visorinput_dev->led) != desired_state) { |
473 | int old_state = (test_bit(led, visorinput_dev->led)); | 473 | input_report_key(visorinput_dev, keycode, 1); |
474 | 474 | input_sync(visorinput_dev); | |
475 | if (old_state != desired_state) { | 475 | input_report_key(visorinput_dev, keycode, 0); |
476 | input_report_key(visorinput_dev, keycode, 1); | 476 | input_sync(visorinput_dev); |
477 | input_sync(visorinput_dev); | 477 | __change_bit(led, visorinput_dev->led); |
478 | input_report_key(visorinput_dev, keycode, 0); | ||
479 | input_sync(visorinput_dev); | ||
480 | __change_bit(led, visorinput_dev->led); | ||
481 | } | ||
482 | } | 478 | } |
483 | } | 479 | } |
484 | 480 | ||