Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73ba8afe authored by Tim Sell's avatar Tim Sell Committed by Greg Kroah-Hartman
Browse files

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: default avatarTim Sell <Timothy.Sell@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0fab0f4f
Loading
Loading
Loading
Loading
+7 −11
Original line number Diff line number Diff line
@@ -467,12 +467,9 @@ 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) {
	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);
@@ -480,7 +477,6 @@ handle_locking_key(struct input_dev *visorinput_dev,
		__change_bit(led, visorinput_dev->led);
	}
}
}

/*
 * <scancode> is either a 1-byte scancode, or an extended 16-bit scancode