From 8ebb68641b7e0d195bfb5e976d65df194f085a25 Mon Sep 17 00:00:00 2001 From: visa Date: Fri, 11 Feb 2022 07:27:07 +0000 Subject: [PATCH] Check klist emptiness instead of NULL pointer in KNOTE() All callers of KNOTE() supply a non-NULL klist argument. Replace the NULL pointer check with klist emptiness check as a small optimization. OK mpi@ --- sys/sys/event.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/sys/event.h b/sys/sys/event.h index 76272cc0280..eb00575fc70 100644 --- a/sys/sys/event.h +++ b/sys/sys/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.63 2022/02/11 07:25:50 visa Exp $ */ +/* $OpenBSD: event.h,v 1.64 2022/02/11 07:27:07 visa Exp $ */ /*- * Copyright (c) 1999,2000,2001 Jonathan Lemon @@ -154,7 +154,7 @@ struct klist { #define KNOTE(list, hint) do { \ struct klist *__list = (list); \ - if (__list != NULL) \ + if (!klist_empty(__list)) \ knote(__list, hint); \ } while (0) -- 2.20.1