Input: joydev - use for_each_set_bit where appropriate
Use for_each_set_bit to check for set bits in bitmap as it is more efficient than checking individual bits. Signed-off-by: Anshul Garg <aksgarg1989@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Родитель
ec0843fabe
Коммит
f23487cdbe
|
@ -798,8 +798,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,
|
||||||
joydev->handle.handler = handler;
|
joydev->handle.handler = handler;
|
||||||
joydev->handle.private = joydev;
|
joydev->handle.private = joydev;
|
||||||
|
|
||||||
for (i = 0; i < ABS_CNT; i++)
|
for_each_set_bit(i, dev->absbit, ABS_CNT) {
|
||||||
if (test_bit(i, dev->absbit)) {
|
|
||||||
joydev->absmap[i] = joydev->nabs;
|
joydev->absmap[i] = joydev->nabs;
|
||||||
joydev->abspam[joydev->nabs] = i;
|
joydev->abspam[joydev->nabs] = i;
|
||||||
joydev->nabs++;
|
joydev->nabs++;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче