Skip to content

Commit

Permalink
Input: ff-core - use for_each_set_bit where appropriate
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
anshulgarg31 authored and dtor committed Jul 9, 2015
1 parent f23487c commit 948cea1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/input/ff-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ int input_ff_create(struct input_dev *dev, unsigned int max_effects)
__set_bit(EV_FF, dev->evbit);

/* Copy "true" bits into ff device bitmap */
for (i = 0; i <= FF_MAX; i++)
if (test_bit(i, dev->ffbit))
__set_bit(i, ff->ffbit);
for_each_set_bit(i, dev->ffbit, FF_CNT)
__set_bit(i, ff->ffbit);

/* we can emulate RUMBLE with periodic effects */
if (test_bit(FF_PERIODIC, ff->ffbit))
Expand Down

0 comments on commit 948cea1

Please sign in to comment.