summaryrefslogtreecommitdiff
path: root/sys/dev/pckbc/psm_intelli.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_intelli.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_intelli.c')
-rw-r--r--sys/dev/pckbc/psm_intelli.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/pckbc/psm_intelli.c b/sys/dev/pckbc/psm_intelli.c
index 983c0be9abd..7a5eb3cc021 100644
--- a/sys/dev/pckbc/psm_intelli.c
+++ b/sys/dev/pckbc/psm_intelli.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psm_intelli.c,v 1.2 2001/02/02 20:25:39 aaron Exp $ */
+/* $OpenBSD: psm_intelli.c,v 1.3 2001/02/19 02:27:06 jbm Exp $ */
/* $NetBSD: psm_intelli.c,v 1.8 2000/06/05 22:20:57 sommerfeld Exp $ */
/*-
@@ -270,16 +270,15 @@ pmsi_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);