Commit b6d30968 authored by Anshul Garg's avatar Anshul Garg Committed by Dmitry Torokhov

Input: uinput - switch to using for_each_set_bit()

Use for_each_set_bit to check for set bits in bitmap
as it is more efficient and compact.
Signed-off-by: default avatarAnshul Garg <aksgarg1989@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 948cea14
......@@ -320,10 +320,8 @@ static int uinput_validate_absbits(struct input_dev *dev)
* Check if absmin/absmax/absfuzz/absflat are sane.
*/
for (cnt = 0; cnt < ABS_CNT; cnt++) {
for_each_set_bit(cnt, dev->absbit, ABS_CNT) {
int min, max;
if (!test_bit(cnt, dev->absbit))
continue;
min = input_abs_get_min(dev, cnt);
max = input_abs_get_max(dev, cnt);
......@@ -416,7 +414,7 @@ static int uinput_setup_device(struct uinput_device *udev,
dev->id.product = user_dev->id.product;
dev->id.version = user_dev->id.version;
for (i = 0; i < ABS_CNT; i++) {
for_each_set_bit(i, dev->absbit, ABS_CNT) {
input_abs_set_max(dev, i, user_dev->absmax[i]);
input_abs_set_min(dev, i, user_dev->absmin[i]);
input_abs_set_fuzz(dev, i, user_dev->absfuzz[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment