diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-11-09 17:53:40 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-11-09 17:53:40 +0000 |
commit | 9473d5ca6183970c256efe065773dda18e76cac4 (patch) | |
tree | c9ec3b4b0898967b165f4e25400b8686f69727b1 /sys/dev | |
parent | 8314ec33d28a7808b9db09541a81f1ac0496c799 (diff) |
Every selwakeup() should have a matching KNOTE() (even if kqueue isn't
supported it doesn't do any harm), so put the KNOTE() in selwakeup() itself and
remove it from any occurences where both are used, except one for kqueue itself
and one in sys_pipe.c (where the selwakeup is under a PIPE_SEL flag).
Based on a diff from tedu.
ok deraadt
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/audio.c | 3 | ||||
-rw-r--r-- | sys/dev/hotplug.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/com.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/cy.c | 3 | ||||
-rw-r--r-- | sys/dev/ic/z8530tty.c | 3 | ||||
-rw-r--r-- | sys/dev/midi.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/bktr/bktr_core.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/cz.c | 3 | ||||
-rw-r--r-- | sys/dev/rnd.c | 3 | ||||
-rw-r--r-- | sys/dev/sbus/magma.c | 3 | ||||
-rw-r--r-- | sys/dev/sbus/spif.c | 3 | ||||
-rw-r--r-- | sys/dev/sequencer.c | 4 | ||||
-rw-r--r-- | sys/dev/systrace.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/ucom.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/ugen.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/uhid.c | 3 | ||||
-rw-r--r-- | sys/dev/usb/usb.c | 3 | ||||
-rw-r--r-- | sys/dev/vscsi.c | 3 | ||||
-rw-r--r-- | sys/dev/wscons/wsdisplay.c | 3 | ||||
-rw-r--r-- | sys/dev/wscons/wseventvar.h | 3 |
20 files changed, 23 insertions, 46 deletions
diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 6dd0f35a685..e3244dc6997 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.106 2009/10/27 12:13:33 jakemsr Exp $ */ +/* $OpenBSD: audio.c,v 1.107 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: audio.c,v 1.119 1999/11/09 16:50:47 augustss Exp $ */ /* @@ -1764,7 +1764,6 @@ audio_selwakeup(struct audio_softc *sc, int play) selwakeup(si); if (sc->sc_async_audio) psignal(sc->sc_async_audio, SIGIO); - KNOTE(&si->si_note, 0); } #define AUDIO_FILTREAD(sc) ( \ diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c index c2bfbfe8234..d8f589bb280 100644 --- a/sys/dev/hotplug.c +++ b/sys/dev/hotplug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hotplug.c,v 1.8 2006/05/28 16:43:49 mk Exp $ */ +/* $OpenBSD: hotplug.c,v 1.9 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -97,7 +97,6 @@ hotplug_put_event(struct hotplug_event *he) evqueue_count++; wakeup(&evqueue); selwakeup(&hotplug_sel); - KNOTE(&hotplug_sel.si_note, 0); return (0); } diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c index 2af5e0306f4..fb06e1360a0 100644 --- a/sys/dev/ic/com.c +++ b/sys/dev/ic/com.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com.c,v 1.136 2009/11/04 19:14:10 kettenis Exp $ */ +/* $OpenBSD: com.c,v 1.137 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */ /* @@ -889,7 +889,6 @@ comstart(struct tty *tp) wakeup(&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); if (tp->t_outq.c_cc == 0) goto stopped; } diff --git a/sys/dev/ic/cy.c b/sys/dev/ic/cy.c index f4d331fae48..bcf7f43023b 100644 --- a/sys/dev/ic/cy.c +++ b/sys/dev/ic/cy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cy.c,v 1.27 2009/10/31 12:00:07 fgsch Exp $ */ +/* $OpenBSD: cy.c,v 1.28 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright (c) 1996 Timo Rossi. * All rights reserved. @@ -629,7 +629,6 @@ cystart(tp) } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); if (tp->t_outq.c_cc == 0) goto out; diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index e2fbb2e9480..f8c9f388b51 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: z8530tty.c,v 1.19 2009/10/31 12:00:08 fgsch Exp $ */ +/* $OpenBSD: z8530tty.c,v 1.20 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: z8530tty.c,v 1.13 1996/10/16 20:42:14 gwr Exp $ */ /* @@ -606,7 +606,6 @@ zsstart(tp) wakeup((caddr_t)&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); } nch = ndqb(&tp->t_outq, 0); /* XXX */ diff --git a/sys/dev/midi.c b/sys/dev/midi.c index 53e2aef6062..64b41efc205 100644 --- a/sys/dev/midi.c +++ b/sys/dev/midi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midi.c,v 1.20 2009/11/01 20:14:12 nicm Exp $ */ +/* $OpenBSD: midi.c,v 1.21 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright (c) 2003, 2004 Alexandre Ratchov @@ -124,7 +124,6 @@ midi_iintr(void *addr, int data) wakeup(&sc->rchan); } selwakeup(&sc->rsel); - KNOTE(&sc->rsel.si_note, 0); if (sc->async) psignal(sc->async, SIGIO); } @@ -224,7 +223,6 @@ midi_out_stop(struct midi_softc *sc) wakeup(&sc->wchan); } selwakeup(&sc->wsel); - KNOTE(&sc->wsel.si_note, 0); if (sc->async) psignal(sc->async, SIGIO); } diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c index a4cde5e1ea9..11c5da0b264 100644 --- a/sys/dev/pci/bktr/bktr_core.c +++ b/sys/dev/pci/bktr/bktr_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_core.c,v 1.27 2009/10/31 06:40:17 deraadt Exp $ */ +/* $OpenBSD: bktr_core.c,v 1.28 2009/11/09 17:53:39 nicm Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */ /* @@ -653,12 +653,11 @@ common_bktr_intr( void *arg ) /* If someone has a select() on /dev/vbi, inform them */ #ifndef __OpenBSD__ if (bktr->vbi_select.si_pid) { -#else - if (bktr->vbi_select.si_selpid) { -#endif selwakeup(&bktr->vbi_select); - KNOTE(&bktr->vbi_select.si_note, 0); } +#else + selwakeup(&bktr->vbi_select); +#endif } diff --git a/sys/dev/pci/cz.c b/sys/dev/pci/cz.c index ae1bb2312eb..0f1377f3e7d 100644 --- a/sys/dev/pci/cz.c +++ b/sys/dev/pci/cz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cz.c,v 1.14 2009/11/02 00:58:22 fgsch Exp $ */ +/* $OpenBSD: cz.c,v 1.15 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: cz.c,v 1.15 2001/01/20 19:10:36 thorpej Exp $ */ /*- @@ -1486,7 +1486,6 @@ czttystart(struct tty *tp) wakeup(&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); if (tp->t_outq.c_cc == 0) goto out; } diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c index 0443af856ed..25c8e8ff9fc 100644 --- a/sys/dev/rnd.c +++ b/sys/dev/rnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rnd.c,v 1.100 2009/06/05 04:43:23 guenther Exp $ */ +/* $OpenBSD: rnd.c,v 1.101 2009/11/09 17:53:39 nicm Exp $ */ /* * rnd.c -- A strong random number generator @@ -732,7 +732,6 @@ dequeue_randomness(void *v) rs->asleep--; wakeup((void *)&rs->asleep); selwakeup(&rnd_rsel); - KNOTE(&rnd_rsel.si_note, 0); } mtx_enter(&rndlock); diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 50336f51d09..8a3a6ba7978 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.19 2009/10/31 12:00:08 fgsch Exp $ */ +/* $OpenBSD: magma.c,v 1.20 2009/11/09 17:53:39 nicm Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -1123,7 +1123,6 @@ mtty_start(struct tty *tp) } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); } /* if something to send, start transmitting diff --git a/sys/dev/sbus/spif.c b/sys/dev/sbus/spif.c index 8a90e089025..df189627d1d 100644 --- a/sys/dev/sbus/spif.c +++ b/sys/dev/sbus/spif.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spif.c,v 1.15 2009/10/31 12:00:08 fgsch Exp $ */ +/* $OpenBSD: spif.c,v 1.16 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright (c) 1999-2002 Jason L. Wright (jason@thought.net) @@ -746,7 +746,6 @@ stty_start(tp) wakeup(&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); } if (tp->t_outq.c_cc) { sp->sp_txc = ndqb(&tp->t_outq, 0); diff --git a/sys/dev/sequencer.c b/sys/dev/sequencer.c index 018bc9e6b46..98bfe88c565 100644 --- a/sys/dev/sequencer.c +++ b/sys/dev/sequencer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sequencer.c,v 1.18 2009/11/01 20:14:12 nicm Exp $ */ +/* $OpenBSD: sequencer.c,v 1.19 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: sequencer.c,v 1.13 1998/11/25 22:17:07 augustss Exp $ */ /* @@ -266,7 +266,6 @@ seq_timeout(void *addr) if (SEQ_QLEN(&sc->outq) < sc->lowat) { seq_wakeup(&sc->wchan); selwakeup(&sc->wsel); - KNOTE(&sc->wsel.si_note, 0); if (sc->async) psignal(sc->async, SIGIO); } @@ -324,7 +323,6 @@ seq_input_event(struct sequencer_softc *sc, seq_event_rec *cmd) SEQ_QPUT(q, *cmd); seq_wakeup(&sc->rchan); selwakeup(&sc->rsel); - KNOTE(&sc->rsel.si_note, 0); if (sc->async) psignal(sc->async, SIGIO); return (0); diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c index f3ede4462d1..72db52f030f 100644 --- a/sys/dev/systrace.c +++ b/sys/dev/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.51 2009/10/31 06:40:16 deraadt Exp $ */ +/* $OpenBSD: systrace.c,v 1.52 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -609,7 +609,6 @@ systrace_wakeup(struct fsystrace *fst) { wakeup((caddr_t)fst); selwakeup(&fst->si); - KNOTE(&fst->si.si_note, 0); } struct proc * diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 41581e084fa..f073c97b661 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucom.c,v 1.45 2009/10/31 12:00:08 fgsch Exp $ */ +/* $OpenBSD: ucom.c,v 1.46 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */ /* @@ -949,7 +949,6 @@ ucomstart(struct tty *tp) wakeup(&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); if (tp->t_outq.c_cc == 0) goto out; } diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index c90c58dcc5a..ec32cf2bf9d 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.60 2009/10/31 06:40:17 deraadt Exp $ */ +/* $OpenBSD: ugen.c,v 1.61 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -822,7 +822,6 @@ ugenintr(usbd_xfer_handle xfer, usbd_private_handle addr, usbd_status status) wakeup(sce); } selwakeup(&sce->rsel); - KNOTE(&sce->rsel.si_note, 0); } void @@ -882,7 +881,6 @@ ugen_isoc_rintr(usbd_xfer_handle xfer, usbd_private_handle addr, wakeup(sce); } selwakeup(&sce->rsel); - KNOTE(&sce->rsel.si_note, 0); } usbd_status diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index 76e0dda1246..f8eb2ad90e5 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.45 2009/10/31 06:40:17 deraadt Exp $ */ +/* $OpenBSD: uhid.c,v 1.46 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -234,7 +234,6 @@ uhid_intr(struct uhidev *addr, void *data, u_int len) wakeup(&sc->sc_q); } selwakeup(&sc->sc_rsel); - KNOTE(&sc->sc_rsel.si_note, 0); if (sc->sc_async != NULL) { DPRINTFN(3, ("uhid_intr: sending SIGIO %p\n", sc->sc_async)); psignal(sc->sc_async, SIGIO); diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 63b17a494f4..21a8a07fbef 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.61 2009/11/04 19:14:10 kettenis Exp $ */ +/* $OpenBSD: usb.c,v 1.62 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -768,7 +768,6 @@ usb_add_event(int type, struct usb_event *uep) SIMPLEQ_INSERT_TAIL(&usb_events, ueq, next); wakeup(&usb_events); selwakeup(&usb_selevent); - KNOTE(&usb_selevent.si_note, 0); if (usb_async_proc != NULL) psignal(usb_async_proc, SIGIO); splx(s); diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index e062d211e2a..2937475ae32 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.3 2009/08/13 19:51:49 dlg Exp $ */ +/* $OpenBSD: vscsi.c,v 1.4 2009/11/09 17:53:39 nicm Exp $ */ /* * Copyright (c) 2008 David Gwynne <dlg@openbsd.org> @@ -194,7 +194,6 @@ vscsi_cmd(struct scsi_xfer *xs) mtx_leave(&sc->sc_ccb_mtx); selwakeup(&sc->sc_sel); - KNOTE(&sc->sc_sel.si_note, 0); if (polled) { rw_enter_read(&sc->sc_ccb_polling); diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index af46c2e27a0..ae36fbc7258 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wsdisplay.c,v 1.96 2009/10/31 14:13:57 deraadt Exp $ */ +/* $OpenBSD: wsdisplay.c,v 1.97 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */ /* @@ -1487,7 +1487,6 @@ low: wakeup((caddr_t)&tp->t_outq); } selwakeup(&tp->t_wsel); - KNOTE(&tp->t_wsel.si_note, 0); } splx(s); } diff --git a/sys/dev/wscons/wseventvar.h b/sys/dev/wscons/wseventvar.h index f507a19d7b1..f1eeb74dcd8 100644 --- a/sys/dev/wscons/wseventvar.h +++ b/sys/dev/wscons/wseventvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wseventvar.h,v 1.5 2009/10/31 14:13:57 deraadt Exp $ */ +/* $OpenBSD: wseventvar.h,v 1.6 2009/11/09 17:53:39 nicm Exp $ */ /* $NetBSD: wseventvar.h,v 1.1 1998/03/22 14:24:03 drochner Exp $ */ /* @@ -94,7 +94,6 @@ struct wseventvar { #define WSEVENT_WAKEUP(ev) { \ selwakeup(&(ev)->sel); \ - KNOTE(&(ev)->sel.si_note, 0); \ if ((ev)->wanted) { \ (ev)->wanted = 0; \ wakeup((caddr_t)(ev)); \ |