Skip to content

Commit 8a038b8

Browse files
mergedtor
authored andcommitted
Input: ar1021_i2c - use BIT to check for a bit
The MSB for the first byte of touch data transmission is always 1. Make it a little more obvious we're testing this bit by using BIT(7). Signed-off-by: Martin Kepplinger <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 61e29ec commit 8a038b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/input/touchscreen/ar1021_i2c.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* License: GPLv2 as published by the FSF.
77
*/
88

9+
#include <linux/bitops.h>
910
#include <linux/module.h>
1011
#include <linux/input.h>
1112
#include <linux/of.h>
@@ -42,7 +43,7 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id)
4243
goto out;
4344

4445
/* sync bit set ? */
45-
if ((data[0] & 0x80) == 0)
46+
if (!(data[0] & BIT(7)))
4647
goto out;
4748

4849
button = data[0] & BIT(0);

0 commit comments

Comments
 (0)