projects
/
deliverable
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec0843f
)
Input: joydev - use for_each_set_bit where appropriate
author
Anshul Garg
<aksgarg1989@gmail.com>
Wed, 8 Jul 2015 23:41:39 +0000
(16:41 -0700)
committer
Dmitry Torokhov
<dmitry.torokhov@gmail.com>
Thu, 9 Jul 2015 04:50:58 +0000
(21:50 -0700)
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>
drivers/input/joydev.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/input/joydev.c
b/drivers/input/joydev.c
index f362883c94e37ce828d18938b7d25790135cf2d1..46862602a5f7db0a0a2731431dc5cb509501eeff 100644
(file)
--- a/
drivers/input/joydev.c
+++ b/
drivers/input/joydev.c
@@
-798,12
+798,11
@@
static int joydev_connect(struct input_handler *handler, struct input_dev *dev,
joydev->handle.handler = handler;
joydev->handle.private = joydev;
- for (i = 0; i < ABS_CNT; i++)
- if (test_bit(i, dev->absbit)) {
- joydev->absmap[i] = joydev->nabs;
- joydev->abspam[joydev->nabs] = i;
- joydev->nabs++;
- }
+ for_each_set_bit(i, dev->absbit, ABS_CNT) {
+ joydev->absmap[i] = joydev->nabs;
+ joydev->abspam[joydev->nabs] = i;
+ joydev->nabs++;
+ }
for (i = BTN_JOYSTICK - BTN_MISC; i < KEY_MAX - BTN_MISC + 1; i++)
if (test_bit(i + BTN_MISC, dev->keybit)) {
This page took
0.025597 seconds
and
5
git commands to generate.