Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2025 21:16:22 GMT
From:      Olivier Certner <olce@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 9e0ef670d8a8 - stable/14 - queue: Fix STAILQ_ASSERT_EMPTY()
Message-ID:  <202502272116.51RLGMpU005406@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by olce:

URL: https://cgit.FreeBSD.org/src/commit/?id=9e0ef670d8a864d161a14cf374add713a659c3cd

commit 9e0ef670d8a864d161a14cf374add713a659c3cd
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-02-27 20:59:41 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-02-27 21:15:40 +0000

    queue: Fix STAILQ_ASSERT_EMPTY()
    
    The 'while' part corresponding to the 'do' was missing.
    
    Did not notice the problem as later commits using it have been stashed
    and never reworked up to now, and it is currently unused in the tree.
    
    While here, fix spacing after the '#define' in the !(_KERNEL &&
    INVARIANS) part.
    
    Fixes:          34740937f7a4 ("queue: New debug macros for STAILQ")
    MFC after:      1 minute
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit d3c4b002d1fd54ac69c1714e208051867ee56dc4)
---
 sys/sys/queue.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index be862c7ce814..38c319704cc4 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -357,7 +357,7 @@ struct {								\
 #define	STAILQ_ASSERT_EMPTY(head) do {					\
 	if (!STAILQ_EMPTY((head)))					\
 		panic("stailq %p is not empty", (head));		\
-}
+} while (0)
 
 /*
  * QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head)
@@ -371,7 +371,7 @@ struct {								\
 } while (0)
 #else
 #define	QMD_STAILQ_CHECK_EMPTY(head)
-#define STAILQ_ASSERT_EMPTY(head)
+#define	STAILQ_ASSERT_EMPTY(head)
 #define	QMD_STAILQ_CHECK_TAIL(head)
 #endif /* (_KERNEL && INVARIANTS) */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502272116.51RLGMpU005406>