]> git.baikalelectronics.ru Git - kernel.git/commit
Input: alps - fix a mismatch between a condition check and its comment
authorHui Wang <hui.wang@canonical.com>
Fri, 19 Jul 2019 09:38:58 +0000 (12:38 +0300)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 19 Jul 2019 09:40:35 +0000 (12:40 +0300)
commita862e899668a483fcf84bc1653d58616375570dc
tree84106fe38fee5b62d054cd96182c1a2ca8fb3720
parentb9a52563992467945ce221b76c9113151985c960
Input: alps - fix a mismatch between a condition check and its comment

In the function alps_is_cs19_trackpoint(), we check if the param[1] is
in the 0x20~0x2f range, but the code we wrote for this checking is not
correct:
(param[1] & 0x20) does not mean param[1] is in the range of 0x20~0x2f,
it also means the param[1] is in the range of 0x30~0x3f, 0x60~0x6f...

Now fix it with a new condition checking ((param[1] & 0xf0) == 0x20).

Fixes: 6699245f2002 ("Input: alps - don't handle ALPS cs19 trackpoint-only device")
Cc: stable@vger.kernel.org
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/alps.c