summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
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/wscons
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/wscons')
-rw-r--r--sys/dev/wscons/wsevent.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/wscons/wsevent.c b/sys/dev/wscons/wsevent.c
index 4547017a3d1..2aacd702078 100644
--- a/sys/dev/wscons/wsevent.c
+++ b/sys/dev/wscons/wsevent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsevent.c,v 1.24 2020/04/07 13:27:51 visa Exp $ */
+/* $OpenBSD: wsevent.c,v 1.25 2020/12/25 12:59:52 visa Exp $ */
/* $NetBSD: wsevent.c,v 1.16 2003/08/07 16:31:29 agc Exp $ */
/*
@@ -236,7 +236,7 @@ wsevent_kqfilter(struct wseventvar *ev, struct knote *kn)
kn->kn_hook = ev;
s = splwsevent();
- klist_insert(klist, kn);
+ klist_insert_locked(klist, kn);
splx(s);
return (0);
@@ -250,7 +250,7 @@ filt_wseventdetach(struct knote *kn)
int s;
s = splwsevent();
- klist_remove(klist, kn);
+ klist_remove_locked(klist, kn);
splx(s);
}