From: visa Date: Fri, 11 Feb 2022 07:27:07 +0000 (+0000) Subject: Check klist emptiness instead of NULL pointer in KNOTE() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8ebb68641b7e0d195bfb5e976d65df194f085a25;p=openbsd 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@ --- 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)