aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredison.jiang <jiangzhipeng@yulong.com>2021-03-19 20:56:00 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-03-20 19:48:37 -0700
commit4895bfe91199e19fd6bc9b43307cf4adb0409746 (patch)
tree20274fb8a7756b1523d1d5939b1821387a379503
parentInput: ims-pcu - drop redundant driver-data assignment (diff)
downloadlinux-dev-4895bfe91199e19fd6bc9b43307cf4adb0409746.tar.xz
linux-dev-4895bfe91199e19fd6bc9b43307cf4adb0409746.zip
Input: lpc32xx_ts - convert to use BIT()
There is error from cppcheck tool. "Shifting signed 32-bit value by 31 bits is undefined behaviour errors" Signed-off-by: edison.jiang <jiangzhipeng@yulong.com> Link: https://lore.kernel.org/r/20210316153150.1207-1-jzp0409@163.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/lpc32xx_ts.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/input/touchscreen/lpc32xx_ts.c b/drivers/input/touchscreen/lpc32xx_ts.c
index b51450b3d943..15b5cb763526 100644
--- a/drivers/input/touchscreen/lpc32xx_ts.c
+++ b/drivers/input/touchscreen/lpc32xx_ts.c
@@ -34,18 +34,18 @@
#define LPC32XX_TSC_AUX_MIN 0x38
#define LPC32XX_TSC_AUX_MAX 0x3C
-#define LPC32XX_TSC_STAT_FIFO_OVRRN (1 << 8)
-#define LPC32XX_TSC_STAT_FIFO_EMPTY (1 << 7)
+#define LPC32XX_TSC_STAT_FIFO_OVRRN BIT(8)
+#define LPC32XX_TSC_STAT_FIFO_EMPTY BIT(7)
#define LPC32XX_TSC_SEL_DEFVAL 0x0284
#define LPC32XX_TSC_ADCCON_IRQ_TO_FIFO_4 (0x1 << 11)
#define LPC32XX_TSC_ADCCON_X_SAMPLE_SIZE(s) ((10 - (s)) << 7)
#define LPC32XX_TSC_ADCCON_Y_SAMPLE_SIZE(s) ((10 - (s)) << 4)
-#define LPC32XX_TSC_ADCCON_POWER_UP (1 << 2)
-#define LPC32XX_TSC_ADCCON_AUTO_EN (1 << 0)
+#define LPC32XX_TSC_ADCCON_POWER_UP BIT(2)
+#define LPC32XX_TSC_ADCCON_AUTO_EN BIT(0)
-#define LPC32XX_TSC_FIFO_TS_P_LEVEL (1 << 31)
+#define LPC32XX_TSC_FIFO_TS_P_LEVEL BIT(31)
#define LPC32XX_TSC_FIFO_NORMALIZE_X_VAL(x) (((x) & 0x03FF0000) >> 16)
#define LPC32XX_TSC_FIFO_NORMALIZE_Y_VAL(y) ((y) & 0x000003FF)