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>
        __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))