summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ukbd.c
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2008-04-16 16:08:40 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2008-04-16 16:08:40 +0000
commit6f7bf811629949f5c95dfb3b40982cfb39e2230f (patch)
tree289b4c48f7cd45799569a19461211a8d2ddae44c /sys/dev/usb/ukbd.c
parent560b073980818797b7b5d4803628f4ef68625d34 (diff)
Use the timeout(9) API the right way: Don't initialize the timeout
cookie all the time, and only call timeout_del if we're not going to timeout_add right away. Testing by johan@, oga@, sthen@, and possibly some more people (thanks). Ok krw@, oga@, sthen@.
Diffstat (limited to 'sys/dev/usb/ukbd.c')
-rw-r--r--sys/dev/usb/ukbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index d73e1bb7ca9..ff6c16459cd 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.39 2008/01/24 14:50:38 robert Exp $ */
+/* $OpenBSD: ukbd.c,v 1.40 2008/04/16 16:08:39 mk Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -735,12 +735,12 @@ ukbd_decode(struct ukbd_softc *sc, struct ukbd_data *ud)
s = spltty();
wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
splx(s);
- timeout_del(&sc->sc_rawrepeat_ch);
if (npress != 0) {
sc->sc_nrep = npress;
timeout_add(&sc->sc_rawrepeat_ch,
hz * REP_DELAY1 / 1000);
- }
+ } else
+ timeout_del(&sc->sc_rawrepeat_ch);
return;
}
#endif