aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/synaptics.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-23 10:02:50 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-03-23 14:49:37 -0700
commit996b9eedd061752bfa0f3a10381515d67db26b3e (patch)
treed8bc039cf364d2f5980a1ee9d8acc31eef82e706 /drivers/input/mouse/synaptics.h
parentInput: qt1070 - add OF device ID table (diff)
downloadlinux-dev-996b9eedd061752bfa0f3a10381515d67db26b3e.tar.xz
linux-dev-996b9eedd061752bfa0f3a10381515d67db26b3e.zip
Input: synaptics - do not mix logical and bitwise operations
Let's stop using !!x to reduce value of trackstick button expression to 0/1 and use shift instead. This removes the following sparse warning: CHECK drivers/input/mouse/synaptics.c drivers/input/mouse/synaptics.c:943:79: warning: dubious: !x | y Also, the bits we are testing are not capabilities, so lets drop "_CAP" suffix from macro names. Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse/synaptics.h')
-rw-r--r--drivers/input/mouse/synaptics.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 116ae2546ace..b76bb7a38472 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -111,9 +111,9 @@
#define SYN_CAP_EXT_BUTTONS_STICK(ex10) ((ex10) & 0x010000)
#define SYN_CAP_SECUREPAD(ex10) ((ex10) & 0x020000)
-#define SYN_CAP_EXT_BUTTON_STICK_L(eb) (!!((eb) & 0x01))
-#define SYN_CAP_EXT_BUTTON_STICK_M(eb) (!!((eb) & 0x02))
-#define SYN_CAP_EXT_BUTTON_STICK_R(eb) (!!((eb) & 0x04))
+#define SYN_EXT_BUTTON_STICK_L(eb) (((eb) & BIT(0)) >> 0)
+#define SYN_EXT_BUTTON_STICK_M(eb) (((eb) & BIT(1)) >> 1)
+#define SYN_EXT_BUTTON_STICK_R(eb) (((eb) & BIT(2)) >> 2)
/* synaptics modes query bits */
#define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))