summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHui Wang <hui.wang@canonical.com>2019-07-19 12:38:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-07-26 10:12:56 +0300
commitc4ffc082c88cb6b212f752b84f2e586d3e8ee5d3 (patch)
tree7c6eb0e2a8fcd4ed863fdceecf5311fb00adbb37 /drivers
parentb972bdd9798f9f5b67255800daee683b94f0f7a1 (diff)
downloadlinux-c4ffc082c88cb6b212f752b84f2e586d3e8ee5d3.tar.xz
Input: alps - fix a mismatch between a condition check and its comment
commit 771a081e44a9baa1991ef011cc453ef425591740 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/mouse/alps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index 11a4363c3b60..dd80ff6cc427 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -2879,7 +2879,7 @@ static bool alps_is_cs19_trackpoint(struct psmouse *psmouse)
* trackpoint-only devices have their variant_ids equal
* TP_VARIANT_ALPS and their firmware_ids are in 0x20~0x2f range.
*/
- return param[0] == TP_VARIANT_ALPS && (param[1] & 0x20);
+ return param[0] == TP_VARIANT_ALPS && ((param[1] & 0xf0) == 0x20);
}
static int alps_identify(struct psmouse *psmouse, struct alps_data *priv)