summaryrefslogtreecommitdiff
path: root/sys/dev/pckbc/psm.c
diff options
context:
space:
mode:
authorjbm <jbm@cvs.openbsd.org>2001-02-19 02:27:07 +0000
committerjbm <jbm@cvs.openbsd.org>2001-02-19 02:27:07 +0000
commit4c3ad8dfd758285bff02f738fe4fa13553800d00 (patch)
treec4c553d9bec399e9314ea1b226c227b5e8bee5e3 /sys/dev/pckbc/psm.c
parent91f5f28e055eb1f53a5bc15bfb9a844eaf3a05c7 (diff)
Fix a bug (bad conversion from unsigned int to int) in PS/2 mouse resolution
setting, so that WSMOUSEIO_SRES ioctl with WSMOUSE_RES_MIN value now works; matthieu@ ok.
Diffstat (limited to 'sys/dev/pckbc/psm.c')
-rw-r--r--sys/dev/pckbc/psm.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/pckbc/psm.c b/sys/dev/pckbc/psm.c
index 0368c83f5b4..fae92f3d4d9 100644
--- a/sys/dev/pckbc/psm.c
+++ b/sys/dev/pckbc/psm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psm.c,v 1.2 2001/02/02 20:20:08 aaron Exp $ */
+/* $OpenBSD: psm.c,v 1.3 2001/02/19 02:27:05 jbm Exp $ */
/* $NetBSD: psm.c,v 1.11 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -251,16 +251,15 @@ pms_ioctl(v, cmd, data, flag, p)
break;
case WSMOUSEIO_SRES:
- i = (*(u_int *)data - 12) / 25;
-
+ i = ((int) *(u_int *)data - 12) / 25;
+ /* valid values are {0,1,2,3} */
if (i < 0)
i = 0;
-
if (i > 3)
i = 3;
-
+
kbcmd[0] = PMS_SET_RES;
- kbcmd[1] = i;
+ kbcmd[1] = (unsigned char) i;
i = pckbc_enqueue_cmd(sc->sc_kbctag, sc->sc_kbcslot, kbcmd,
2, 0, 1, 0);