From: visa Date: Fri, 11 Feb 2022 07:25:50 +0000 (+0000) Subject: Inline klist_empty() for more economic machine code. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=608b7d9a13f1d8e92a4a4703c2beeba52848e623;p=openbsd Inline klist_empty() for more economic machine code. OK mpi@ --- diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 0c651ee6076..25a438f7709 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_event.c,v 1.179 2022/02/08 08:56:41 visa Exp $ */ +/* $OpenBSD: kern_event.c,v 1.180 2022/02/11 07:25:50 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -2095,12 +2095,6 @@ klist_remove_locked(struct klist *klist, struct knote *kn) SLIST_REMOVE(&klist->kl_list, kn, knote, kn_selnext); } -int -klist_empty(struct klist *klist) -{ - return (SLIST_EMPTY(&klist->kl_list)); -} - /* * Detach all knotes from klist. The knotes are rewired to indicate EOF. * diff --git a/sys/sys/event.h b/sys/sys/event.h index 4a864343132..76272cc0280 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.62 2022/02/08 08:56:41 visa Exp $ */ +/* $OpenBSD: event.h,v 1.63 2022/02/11 07:25:50 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -314,9 +314,14 @@ extern void klist_insert(struct klist *, struct knote *); extern void klist_insert_locked(struct klist *, struct knote *); extern void klist_remove(struct klist *, struct knote *); extern void klist_remove_locked(struct klist *, struct knote *); -extern int klist_empty(struct klist *); extern void klist_invalidate(struct klist *); +static inline int +klist_empty(struct klist *klist) +{ + return (SLIST_EMPTY(&klist->kl_list)); +} + #else /* !_KERNEL */ #include