Input: atmel_mxt_ts - use BIT() macro when reporting button state
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 15 Apr 2015 17:31:10 +0000 (10:31 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 20 May 2015 21:49:36 +0000 (14:49 -0700)
This makes the intent a tad more clear.

Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/atmel_mxt_ts.c

index 40b98dda8f38be802c7896e4652bb7591c57c88c..dfc7309e3d3898b88e5fa5add0451490a08f1a8c 100644 (file)
@@ -726,15 +726,15 @@ static void mxt_input_button(struct mxt_data *data, u8 *message)
 {
        struct input_dev *input = data->input_dev;
        const struct mxt_platform_data *pdata = data->pdata;
-       bool button;
        int i;
 
-       /* Active-low switch */
        for (i = 0; i < pdata->t19_num_keys; i++) {
                if (pdata->t19_keymap[i] == KEY_RESERVED)
                        continue;
-               button = !(message[1] & (1 << i));
-               input_report_key(input, pdata->t19_keymap[i], button);
+
+               /* Active-low switch */
+               input_report_key(input, pdata->t19_keymap[i],
+                                !(message[1] & BIT(i)));
        }
 }