Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2025 21:11:49 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: 4fd887f08b00 - stable/13 - queue: Fix STAILQ_ASSERT_EMPTY()
Message-ID:  <202502272111.51RLBna7098611@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=4fd887f08b000173c196e954b510752025ff3fc0

commit 4fd887f08b000173c196e954b510752025ff3fc0
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:11:10 +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 0b1e1f9fba55..31a220bcdcc0 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -356,7 +356,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)
@@ -370,7 +370,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?202502272111.51RLBna7098611>