Skip to content
Commit 3e2b03da authored by Anshul Garg's avatar Anshul Garg Committed by Dmitry Torokhov
Browse files

Input: use for_each_set_bit() where appropriate



Instead of iterating over all bits in a bitmap and test them individually
let's siwtch to for_each_set_bit() which is more compact and is also
faster.

Also use bitmap_weight() when counting number of set bits.

This also fixes INPUT_DO_TOGGLE() implementation as it should have used
*_CNT as the upper boundary, not *_MAX.

Signed-off-by: default avatarAnshul Garg <aksgarg1989@gmail.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 3e30c11c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment