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: Anshul Garg <aksgarg1989@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
948cea1448
commit
b6d30968d8
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue