From 85c77397519522a5af92f59e210aaf853ef86b8f Mon Sep 17 00:00:00 2001 From: stsp Date: Sun, 18 May 2014 15:27:28 +0000 Subject: [PATCH] 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. --- sys/dev/pckbc/pms.c | 4 ++-- 1 file 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; } -- 2.20.1