summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ugen.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2020-12-25 12:59:54 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2020-12-25 12:59:54 +0000
commit0ddae2e43bde351e699797b713fdfd0c4d71688b (patch)
tree5c305222f703a8c48618339303894fe5bf0e271e /sys/dev/usb/ugen.c
parentd5d6ba970dd241df83e52a3f686a5b3c47e2b215 (diff)
Refactor klist insertion and removal
Rename klist_{insert,remove}() to klist_{insert,remove}_locked(). These functions assume that the caller has locked the klist. The current state of locking remains intact because the kernel lock is still used with all klists. Add new functions klist_insert() and klist_remove() that lock the klist internally. This allows some code simplification. OK mpi@
Diffstat (limited to 'sys/dev/usb/ugen.c')
-rw-r--r--sys/dev/usb/ugen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 5b8bdc30393..6a27d3f6410 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.108 2020/09/29 09:11:44 mpi Exp $ */
+/* $OpenBSD: ugen.c,v 1.109 2020/12/25 12:59:52 visa 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 $ */
@@ -1304,7 +1304,7 @@ filt_ugenrdetach(struct knote *kn)
int s;
s = splusb();
- klist_remove(&sce->rsel.si_note, kn);
+ klist_remove_locked(&sce->rsel.si_note, kn);
splx(s);
}
@@ -1413,7 +1413,7 @@ ugenkqfilter(dev_t dev, struct knote *kn)
kn->kn_hook = (void *)sce;
s = splusb();
- klist_insert(klist, kn);
+ klist_insert_locked(klist, kn);
splx(s);
return (0);