diff options
author | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-11-23 15:43:03 +0000 |
---|---|---|
committer | Marc Balmer <mbalmer@cvs.openbsd.org> | 2007-11-23 15:43:03 +0000 |
commit | c1c4b626b699581b962cfad225cc35995f811251 (patch) | |
tree | 182988f9093b3f2c927fe6cf9d2d23199a20de4a /sys/dev/usb/if_udav.c | |
parent | fc18ac9085d0963e9ca450f94e6bf954e9f30ef9 (diff) |
Sanitize the use of timeouts:
Instead of calling timeout_set(..., NULL, NULL) in attach routines and
later
timeout_del(...)
timeout_set(..., func, arg)
timeout_add(..., time)
set the function and argument in the initial timeout_set() call and only
use timeout_add(..., time) later.
ok dlg, fgsch, krw, winiger
Diffstat (limited to 'sys/dev/usb/if_udav.c')
-rw-r--r-- | sys/dev/usb/if_udav.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 46b0afd6a97..028ddc22dde 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.39 2007/11/01 17:10:34 deraadt Exp $ */ +/* $OpenBSD: if_udav.c,v 1.40 2007/11/23 15:43:02 mbalmer Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -305,7 +305,7 @@ udav_attach(struct device *parent, struct device *self, void *aux) if_attach(ifp); ether_ifattach(ifp); - timeout_set(&sc->sc_stat_ch, NULL, NULL); + timeout_set(&sc->sc_stat_ch, udav_tick, sc); sc->sc_attached = 1; splx(s); @@ -683,8 +683,6 @@ udav_init(struct ifnet *ifp) splx(s); - timeout_del(&sc->sc_stat_ch); - timeout_set(&sc->sc_stat_ch, udav_tick, sc); timeout_add(&sc->sc_stat_ch, hz); return (0); @@ -1499,8 +1497,6 @@ udav_tick_task(void *xsc) udav_start(ifp); } - timeout_del(&sc->sc_stat_ch); - timeout_set(&sc->sc_stat_ch, udav_tick, sc); timeout_add(&sc->sc_stat_ch, hz); splx(s); |