summaryrefslogtreecommitdiff
path: root/sys/dev/pckbc
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2014-05-18 15:27:29 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2014-05-18 15:27:29 +0000
commit71d320319e148f051f2626b43db562eebf3f6c76 (patch)
treeb8237aedef09f700a4a1220bf62ba3c959a896b3 /sys/dev/pckbc
parent4367921889d4319c7c61468f131d7e41a04199a0 (diff)
Fix tail packet check in elantech v3 touchpad code. Due to a typo this
code was masking out bits which were also tested in the same expression. Reported by cppcheck via jsg@ (Expression '(X & 0xfc) != 0x2' is always true). Tested with Elantech Touchpad, version 3, firmware 0x250f00.
Diffstat (limited to 'sys/dev/pckbc')
-rw-r--r--sys/dev/pckbc/pms.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pckbc/pms.c b/sys/dev/pckbc/pms.c
index 4a6de176166..4799c8c7438 100644
--- a/sys/dev/pckbc/pms.c
+++ b/sys/dev/pckbc/pms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pms.c,v 1.50 2014/04/25 10:33:36 mpi Exp $ */
+/* $OpenBSD: pms.c,v 1.51 2014/05/18 15:27:28 stsp Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -2189,7 +2189,7 @@ pms_proc_elantech_v3(struct pms_softc *sc)
* the tail packet.
*/
if ((sc->packet[0] & 0x0c) != 0x04 &&
- (sc->packet[3] & 0xfc) != 0x02) {
+ (sc->packet[3] & 0xcf) != 0x02) {
/* not the head packet -- ignore */
return;
}