Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2025 23:34:53 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: cf411e5ed3a0 - releng/13.5 - queue: Fix STAILQ_ASSERT_EMPTY()
Message-ID:  <202502272334.51RNYrWL065884@gitrepo.freebsd.org>

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

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

commit cf411e5ed3a0fdb9fb58866b98802f7f6d3597f1
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2025-02-27 20:59:41 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2025-02-27 23:33:27 +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)
    (cherry picked from commit 4fd887f08b000173c196e954b510752025ff3fc0)
    
    Approved by:    re (cperciva)
---
 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?202502272334.51RNYrWL065884>