瀏覽代碼

Input: atmel_mxt_ts - use BIT() macro when reporting button state

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>
Dmitry Torokhov 10 年之前
父節點
當前提交
c37f6d3879
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      drivers/input/touchscreen/atmel_mxt_ts.c

+ 4 - 4
drivers/input/touchscreen/atmel_mxt_ts.c

@@ -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)));
 	}
 }