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>
This commit is contained in:
parent
0fab0f4fcb
commit
73ba8afe33
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue