From: Martin Kepplinger Date: Mon, 1 May 2017 17:13:47 +0000 (-0700) Subject: Input: ar1021_i2c - use BIT to check for a bit X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8a038b83e012097a7ac6cfb9f6c5fac1da8fad6e;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c index 21c74ee59341..f9dcbd63e598 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c @@ -6,6 +6,7 @@ * License: GPLv2 as published by the FSF. */ +#include #include #include #include @@ -42,7 +43,7 @@ static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) goto out; /* sync bit set ? */ - if ((data[0] & 0x80) == 0) + if (!(data[0] & BIT(7))) goto out; button = data[0] & BIT(0);