From: Anshul Garg Date: Wed, 8 Jul 2015 23:43:20 +0000 (-0700) Subject: Input: ff-core - use for_each_set_bit where appropriate X-Git-Tag: firefly_0821_release~176^2~541^2~41^2~69 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=948cea14487af7d6e8b8007dc24a5361869f410b;p=firefly-linux-kernel-4.4.55.git Input: ff-core - 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/ff-core.c b/drivers/input/ff-core.c index 8f4a30fccbb6..c64208267198 100644 --- a/drivers/input/ff-core.c +++ b/drivers/input/ff-core.c @@ -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))