From: Andreas Bosch Date: Wed, 15 Oct 2014 17:44:50 +0000 (-0700) Subject: Input: alps - fix v4 button press recognition X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b0cfb794a3dd1d699f3e453f9180bd06508fb8f0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Input: alps - fix v4 button press recognition Since the change to struct input_mt_pos some variables are now bitfields instead of integers. Automatic conversion from integer to bitfield entry destroys information, therefore enforce boolean interpretation instead. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1114768 Fixes: 02d04254a5df ("Input: alps - use struct input_mt_pos to track coordinates") Signed-off-by: Andreas Bosch Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 35a49bf57227..2b0ae8cc8e51 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c @@ -835,8 +835,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse) f->fingers = alps_process_bitmap(priv, f); } - f->left = packet[4] & 0x01; - f->right = packet[4] & 0x02; + f->left = !!(packet[4] & 0x01); + f->right = !!(packet[4] & 0x02); f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | ((packet[0] & 0x30) >> 4);