summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorAnshul Garg <aksgarg1989@gmail.com>2015-07-09 10:18:22 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-09 11:19:25 -0700
commitb6d30968d86c45a7bb599eaca13ff048d3fa576c (patch)
treef026fba2993fff9bba17f2584d6988957378271b /drivers/input
parent948cea14487af7d6e8b8007dc24a5361869f410b (diff)
downloadblackbird-op-linux-b6d30968d86c45a7bb599eaca13ff048d3fa576c.tar.gz
blackbird-op-linux-b6d30968d86c45a7bb599eaca13ff048d3fa576c.zip
Input: uinput - switch to using for_each_set_bit()
Use for_each_set_bit to check for set bits in bitmap as it is more efficient and compact. Signed-off-by: Anshul Garg <aksgarg1989@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/uinput.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 421e29e4cd81..345df9b03aed 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -320,10 +320,8 @@ static int uinput_validate_absbits(struct input_dev *dev)
* Check if absmin/absmax/absfuzz/absflat are sane.
*/
- for (cnt = 0; cnt < ABS_CNT; cnt++) {
+ for_each_set_bit(cnt, dev->absbit, ABS_CNT) {
int min, max;
- if (!test_bit(cnt, dev->absbit))
- continue;
min = input_abs_get_min(dev, cnt);
max = input_abs_get_max(dev, cnt);
@@ -416,7 +414,7 @@ static int uinput_setup_device(struct uinput_device *udev,
dev->id.product = user_dev->id.product;
dev->id.version = user_dev->id.version;
- for (i = 0; i < ABS_CNT; i++) {
+ for_each_set_bit(i, dev->absbit, ABS_CNT) {
input_abs_set_max(dev, i, user_dev->absmax[i]);
input_abs_set_min(dev, i, user_dev->absmin[i]);
input_abs_set_fuzz(dev, i, user_dev->absfuzz[i]);
OpenPOWER on IntegriCloud