summaryrefslogtreecommitdiff
path: root/sys/arch/arm64
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/arch/arm64
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/arch/arm64')
-rw-r--r--sys/arch/arm64/dev/apm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/arm64/dev/apm.c b/sys/arch/arm64/dev/apm.c
index 31f22a877a0..f7072611cc3 100644
--- a/sys/arch/arm64/dev/apm.c
+++ b/sys/arch/arm64/dev/apm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apm.c,v 1.5 2020/05/29 04:42:23 deraadt Exp $ */
+/* $OpenBSD: apm.c,v 1.6 2020/12/25 12:59:51 visa Exp $ */
/*-
* Copyright (c) 2001 Alexander Guy. All rights reserved.
@@ -270,7 +270,7 @@ filt_apmrdetach(struct knote *kn)
{
struct apm_softc *sc = (struct apm_softc *)kn->kn_hook;
- klist_remove(&sc->sc_note, kn);
+ klist_remove_locked(&sc->sc_note, kn);
}
int
@@ -302,7 +302,7 @@ apmkqfilter(dev_t dev, struct knote *kn)
}
kn->kn_hook = (caddr_t)sc;
- klist_insert(&sc->sc_note, kn);
+ klist_insert_locked(&sc->sc_note, kn);
return (0);
}