]> git.proxmox.com Git - mirror_ubuntu-disco-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 14:39:17 +0000 (22:39 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 13 Aug 2019 12:18:20 +0000 (14:18 +0200)
commit144dc988fbeb7e05982a03aafb7cbcc19fcb63f8
tree4faf1cfbeb8eb4297758e278bdf74a1725bbb684
parent529d6b3397dfd367855001876c8805f998bec9c2
Input: alps - fix a mismatch between a condition check and its comment

BugLink: https://bugs.launchpad.net/bugs/1836752
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: 7e4935ccc323 ("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>
(cherry picked from commit 771a081e44a9baa1991ef011cc453ef425591740)
Signed-off-by: Hui Wang <hui.wang@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/input/mouse/alps.c