Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Replace callout_stop with callout_halt
details: https://anonhg.NetBSD.org/src/rev/ea5139379754
branches: trunk
changeset: 333788:ea5139379754
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Sun Nov 16 16:20:00 2014 +0000
description:
Replace callout_stop with callout_halt
In order to call callout_destroy for a callout safely, we have to ensure
the function of the callout is not running and pending. To do so, we should
use callout_halt, not callout_stop.
Discussed with martin@ and riastradh@.
diffstat:
sys/arch/x86/pci/fwhrng.c | 6 +++---
sys/arch/x86/x86/via_padlock.c | 6 +++---
sys/dev/bluetooth/bcsp.c | 8 ++++----
sys/dev/bluetooth/btkbd.c | 7 +++----
sys/dev/ic/nslm7x.c | 6 +++---
sys/dev/ir/irframe_tty.c | 6 +++---
sys/dev/isa/aps.c | 6 +++---
sys/dev/pci/pccbb.c | 6 +++---
sys/dev/pcmcia/btbc.c | 6 +++---
sys/dev/sdmmc/sdmmc.c | 6 +++---
sys/dev/wscons/wskbd.c | 6 +++---
sys/net/if_ecosubr.c | 6 +++---
12 files changed, 37 insertions(+), 38 deletions(-)
diffs (truncated from 330 to 300 lines):
diff -r 02460a2874db -r ea5139379754 sys/arch/x86/pci/fwhrng.c
--- a/sys/arch/x86/pci/fwhrng.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/arch/x86/pci/fwhrng.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fwhrng.c,v 1.7 2014/08/10 16:44:34 tls Exp $ */
+/* $NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwhrng.c,v 1.7 2014/08/10 16:44:34 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -211,7 +211,7 @@
rnd_detach_source(&sc->sc_rnd_source);
- callout_stop(&sc->sc_rnd_ch);
+ callout_halt(&sc->sc_rnd_ch, NULL);
callout_destroy(&sc->sc_rnd_ch);
/* Disable the RNG. */
diff -r 02460a2874db -r ea5139379754 sys/arch/x86/x86/via_padlock.c
--- a/sys/arch/x86/x86/via_padlock.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/arch/x86/x86/via_padlock.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,5 +1,5 @@
/* $OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $ */
-/* $NetBSD: via_padlock.c,v 1.22 2014/08/10 16:44:34 tls Exp $ */
+/* $NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $ */
/*-
* Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.22 2014/08/10 16:44:34 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -626,7 +626,7 @@
struct via_padlock_softc *sc = device_private(self);
if (sc->sc_rnd_attached) {
- callout_stop(&sc->sc_rnd_co);
+ callout_halt(&sc->sc_rnd_co, NULL);
callout_destroy(&sc->sc_rnd_co);
rnd_detach_source(&sc->sc_rnd_source);
sc->sc_rnd_attached = false;
diff -r 02460a2874db -r ea5139379754 sys/dev/bluetooth/bcsp.c
--- a/sys/dev/bluetooth/bcsp.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/bluetooth/bcsp.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $ */
+/* $NetBSD: bcsp.c,v 1.25 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* Copyright (c) 2007 KIYOHARA Takashi
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.24 2014/05/20 18:25:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.25 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -349,10 +349,10 @@
sc->sc_unit = NULL;
}
- callout_stop(&sc->sc_seq_timer);
+ callout_halt(&sc->sc_seq_timer, NULL);
callout_destroy(&sc->sc_seq_timer);
- callout_stop(&sc->sc_le_timer);
+ callout_halt(&sc->sc_le_timer, NULL);
callout_destroy(&sc->sc_le_timer);
return 0;
diff -r 02460a2874db -r ea5139379754 sys/dev/bluetooth/btkbd.c
--- a/sys/dev/bluetooth/btkbd.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/bluetooth/btkbd.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: btkbd.c,v 1.16 2013/09/12 12:20:01 martin Exp $ */
+/* $NetBSD: btkbd.c,v 1.17 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.16 2013/09/12 12:20:01 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btkbd.c,v 1.17 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -251,8 +251,7 @@
#ifdef WSDISPLAY_COMPAT_RAWKBD
#ifdef BTKBD_REPEAT
- callout_stop(&sc->sc_repeat);
- KASSERT(!callout_invoking(&sc->sc_repeat));
+ callout_halt(&sc->sc_repeat, NULL);
callout_destroy(&sc->sc_repeat);
#endif
#endif
diff -r 02460a2874db -r ea5139379754 sys/dev/ic/nslm7x.c
--- a/sys/dev/ic/nslm7x.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/ic/nslm7x.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nslm7x.c,v 1.60 2013/10/20 21:13:15 christos Exp $ */
+/* $NetBSD: nslm7x.c,v 1.61 2014/11/16 16:20:00 ozaki-r Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.60 2013/10/20 21:13:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.61 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1703,7 +1703,7 @@
void
lm_detach(struct lm_softc *lmsc)
{
- callout_stop(&lmsc->sc_callout);
+ callout_halt(&lmsc->sc_callout, NULL);
callout_destroy(&lmsc->sc_callout);
sysmon_envsys_unregister(lmsc->sc_sme);
}
diff -r 02460a2874db -r ea5139379754 sys/dev/ir/irframe_tty.c
--- a/sys/dev/ir/irframe_tty.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/ir/irframe_tty.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: irframe_tty.c,v 1.59 2013/12/16 15:49:40 mrg Exp $ */
+/* $NetBSD: irframe_tty.c,v 1.60 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* TODO
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.59 2013/12/16 15:49:40 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: irframe_tty.c,v 1.60 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -245,7 +245,7 @@
struct irframet_softc *sc = device_private(dev);
int rc;
- callout_stop(&sc->sc_timeout);
+ callout_halt(&sc->sc_timeout, NULL);
rc = irframe_detach(dev, flags);
diff -r 02460a2874db -r ea5139379754 sys/dev/isa/aps.c
--- a/sys/dev/isa/aps.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/isa/aps.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: aps.c,v 1.15 2012/08/14 14:36:43 jruoho Exp $ */
+/* $NetBSD: aps.c,v 1.16 2014/11/16 16:20:00 ozaki-r Exp $ */
/* $OpenBSD: aps.c,v 1.15 2007/05/19 19:14:11 tedu Exp $ */
/* $OpenBSD: aps.c,v 1.17 2008/06/27 06:08:43 canacar Exp $ */
/*
@@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aps.c,v 1.15 2012/08/14 14:36:43 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aps.c,v 1.16 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -429,7 +429,7 @@
{
struct aps_softc *sc = device_private(self);
- callout_stop(&sc->sc_callout);
+ callout_halt(&sc->sc_callout, NULL);
callout_destroy(&sc->sc_callout);
if (sc->sc_sme)
diff -r 02460a2874db -r ea5139379754 sys/dev/pci/pccbb.c
--- a/sys/dev/pci/pccbb.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/pci/pccbb.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pccbb.c,v 1.206 2014/03/29 19:28:25 christos Exp $ */
+/* $NetBSD: pccbb.c,v 1.207 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* Copyright (c) 1998, 1999 and 2000
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.206 2014/03/29 19:28:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.207 2014/11/16 16:20:00 ozaki-r Exp $");
/*
#define CBB_DEBUG
@@ -560,7 +560,7 @@
if (!TAILQ_EMPTY(&sc->sc_memwindow))
aprint_error_dev(self, "memory windows not empty");
- callout_stop(&sc->sc_insert_ch);
+ callout_halt(&sc->sc_insert_ch, NULL);
callout_destroy(&sc->sc_insert_ch);
mutex_destroy(&sc->sc_pwr_mtx);
diff -r 02460a2874db -r ea5139379754 sys/dev/pcmcia/btbc.c
--- a/sys/dev/pcmcia/btbc.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/pcmcia/btbc.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: btbc.c,v 1.16 2014/05/20 18:25:54 rmind Exp $ */
+/* $NetBSD: btbc.c,v 1.17 2014/11/16 16:20:00 ozaki-r Exp $ */
/*
* Copyright (c) 2007 KIYOHARA Takashi
* All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btbc.c,v 1.16 2014/05/20 18:25:54 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btbc.c,v 1.17 2014/11/16 16:20:00 ozaki-r Exp $");
#include <sys/param.h>
#include <sys/callout.h>
@@ -210,7 +210,7 @@
pmf_device_deregister(self);
btbc_disable(sc->sc_dev);
- callout_stop(&sc->sc_ledch);
+ callout_halt(&sc->sc_ledch, NULL);
callout_destroy(&sc->sc_ledch);
if (sc->sc_unit) {
diff -r 02460a2874db -r ea5139379754 sys/dev/sdmmc/sdmmc.c
--- a/sys/dev/sdmmc/sdmmc.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/sdmmc/sdmmc.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sdmmc.c,v 1.22 2014/03/19 15:26:42 nonaka Exp $ */
+/* $NetBSD: sdmmc.c,v 1.23 2014/11/16 16:20:01 ozaki-r Exp $ */
/* $OpenBSD: sdmmc.c,v 1.18 2009/01/09 10:58:38 jsg Exp $ */
/*
@@ -49,7 +49,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.22 2014/03/19 15:26:42 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdmmc.c,v 1.23 2014/11/16 16:20:01 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_sdmmc.h"
@@ -199,7 +199,7 @@
}
if (ISSET(sc->sc_caps, SMC_CAPS_POLL_CARD_DET)) {
- callout_stop(&sc->sc_card_detect_ch);
+ callout_halt(&sc->sc_card_detect_ch, NULL);
callout_destroy(&sc->sc_card_detect_ch);
}
diff -r 02460a2874db -r ea5139379754 sys/dev/wscons/wskbd.c
--- a/sys/dev/wscons/wskbd.c Sun Nov 16 16:11:33 2014 +0000
+++ b/sys/dev/wscons/wskbd.c Sun Nov 16 16:20:00 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.134 2014/07/25 08:10:39 dholland Exp $ */
+/* $NetBSD: wskbd.c,v 1.135 2014/11/16 16:20:01 ozaki-r Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.134 2014/07/25 08:10:39 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.135 2014/11/16 16:20:01 ozaki-r Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -634,7 +634,7 @@
wsmux_detach_sc(&sc->sc_base);
#endif
- callout_stop(&sc->sc_repeat_ch);
+ callout_halt(&sc->sc_repeat_ch, NULL);
Home |
Main Index |
Thread Index |
Old Index