From: checkpatch@dpdk.org
To: test-report@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: |WARNING| pw158355 [PATCH v3 02/44] eal: add BSD version of queue.h
Date: Mon, 3 Nov 2025 17:51:26 +0100 (CET) [thread overview]
Message-ID: <20251103165126.B4CCE1261CB@dpdk.org> (raw)
In-Reply-To: <20251103164915.101713-3-stephen@networkplumber.org>
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/158355
_coding style issues_
WARNING:SPACING: space prohibited between function name and open parenthesis '('
#522: FILE: lib/eal/include/rte_bsd_queue.h:98:
+#warn Use QUEUE_MACRO_DEBUG_xxx instead (TRACE, TRASH and/or ASSERTIONS)
WARNING:TRAILING_SEMICOLON: macros should not use a trailing semicolon
#535: FILE: lib/eal/include/rte_bsd_queue.h:111:
+#define TRACEBUF struct qm_trace trace;
ERROR:SPACING: space prohibited before that ',' (ctx:WxE)
#536: FILE: lib/eal/include/rte_bsd_queue.h:112:
+#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } ,
^
ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#536: FILE: lib/eal/include/rte_bsd_queue.h:112:
+#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } ,
BUT SEE:
do {} while (0) advice is over-stated in a few situations:
The more obvious case is macros, like MODULE_PARM_DESC, invoked at
file-scope, where C disallows code (it must be in functions). See
$exceptions if you have one to add by name.
More troublesome is declarative macros used at top of new scope,
like DECLARE_PER_CPU. These might just compile with a do-while-0
wrapper, but would be incorrect. Most of these are handled by
detecting struct,union,etc declaration primitives in $exceptions.
Theres also macros called inside an if (block), which "return" an
expression. These cannot do-while, and need a ({}) wrapper.
Enjoy this qualification while we work to improve our heuristics.
ERROR:SPACING: space required after that ';' (ctx:VxV)
#561: FILE: lib/eal/include/rte_bsd_queue.h:137:
+#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
^
WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#561: FILE: lib/eal/include/rte_bsd_queue.h:137:
+#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#570: FILE: lib/eal/include/rte_bsd_queue.h:146:
+ defined(QUEUE_MACRO_NO_DEBUG_ASSERTIONS)$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#580: FILE: lib/eal/include/rte_bsd_queue.h:156:
+ !defined(QUEUE_MACRO_NO_DEBUG_ASSERTIONS) &&^I^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#581: FILE: lib/eal/include/rte_bsd_queue.h:157:
+ (defined(_KERNEL) && defined(INVARIANTS))$
WARNING:TYPO_SPELLING: 'stdio' may be misspelled - perhaps 'studio'?
#591: FILE: lib/eal/include/rte_bsd_queue.h:167:
+#include <stdio.h>
^^^^^
WARNING:MACRO_ARG_UNUSED: Argument 'test' is not used in function-like macro
#608: FILE: lib/eal/include/rte_bsd_queue.h:184:
+#define QMD_ASSERT(test, fmt, ...) do {} while (0)
WARNING:MACRO_ARG_UNUSED: Argument 'fmt' is not used in function-like macro
#608: FILE: lib/eal/include/rte_bsd_queue.h:184:
+#define QMD_ASSERT(test, fmt, ...) do {} while (0)
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#635: FILE: lib/eal/include/rte_bsd_queue.h:211:
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#666: FILE: lib/eal/include/rte_bsd_queue.h:242:
+ QUEUE_TYPEOF(type) *_Curelm = SLIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#668: FILE: lib/eal/include/rte_bsd_queue.h:244:
+ if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \
WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#710: FILE: lib/eal/include/rte_bsd_queue.h:286:
+#define SLIST_INIT(head) do { \
+ SLIST_FIRST((head)) = NULL; \
+} while (0)
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#731: FILE: lib/eal/include/rte_bsd_queue.h:307:
+ QUEUE_TYPEOF(type) *_Curelm = SLIST_FIRST(head); \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#764: FILE: lib/eal/include/rte_bsd_queue.h:340:
+ QUEUE_TYPEOF(type) *_Swap_first = SLIST_FIRST(head1); \
^
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#769: FILE: lib/eal/include/rte_bsd_queue.h:345:
+#define SLIST_END(head) NULL
ERROR:SPACING: space required before the open parenthesis '('
#854: FILE: lib/eal/include/rte_bsd_queue.h:430:
+ for((var) = STAILQ_FIRST((head)); \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#879: FILE: lib/eal/include/rte_bsd_queue.h:455:
+ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#885: FILE: lib/eal/include/rte_bsd_queue.h:461:
+ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#910: FILE: lib/eal/include/rte_bsd_queue.h:486:
+ QUEUE_TYPEOF(type) *_Curelm = STAILQ_FIRST(head); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#919: FILE: lib/eal/include/rte_bsd_queue.h:495:
+ if ((STAILQ_NEXT(elm, field) = \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#925: FILE: lib/eal/include/rte_bsd_queue.h:501:
+ if ((STAILQ_FIRST((head)) = \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#945: FILE: lib/eal/include/rte_bsd_queue.h:521:
+ QUEUE_TYPEOF(type) *_Swap_first = STAILQ_FIRST(head1); \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxO)
#946: FILE: lib/eal/include/rte_bsd_queue.h:522:
+ QUEUE_TYPEOF(type) **_Swap_last = (head1)->stqh_last; \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#960: FILE: lib/eal/include/rte_bsd_queue.h:536:
+ QUEUE_TYPEOF(type) *_Var, *_Varp, *_Varn; \
^
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#972: FILE: lib/eal/include/rte_bsd_queue.h:548:
+#define STAILQ_END(head) NULL
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#989: FILE: lib/eal/include/rte_bsd_queue.h:565:
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#1051: FILE: lib/eal/include/rte_bsd_queue.h:627:
+ QUEUE_TYPEOF(type) *_Curelm = LIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1053: FILE: lib/eal/include/rte_bsd_queue.h:629:
+ if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \
WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#1094: FILE: lib/eal/include/rte_bsd_queue.h:670:
+#define LIST_INIT(head) do { \
+ LIST_FIRST((head)) = NULL; \
+} while (0)
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1100: FILE: lib/eal/include/rte_bsd_queue.h:676:
+ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1117: FILE: lib/eal/include/rte_bsd_queue.h:693:
+ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#1175: FILE: lib/eal/include/rte_bsd_queue.h:751:
+ QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1178: FILE: lib/eal/include/rte_bsd_queue.h:754:
+ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1180: FILE: lib/eal/include/rte_bsd_queue.h:756:
+ if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#1184: FILE: lib/eal/include/rte_bsd_queue.h:760:
+#define LIST_END(head) NULL
WARNING:MACRO_ARG_UNUSED: Argument 'field' is not used in function-like macro
#1243: FILE: lib/eal/include/rte_bsd_queue.h:819:
+#define QMD_TAILQ_CHECK_TAIL(head, field) \
+ QMD_ASSERT(*(head)->tqh_last == NULL, \
+ "Bad tailq NEXT(%p->tqh_last) != NULL", \
+ (head))
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1343: FILE: lib/eal/include/rte_bsd_queue.h:919:
+ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1368: FILE: lib/eal/include/rte_bsd_queue.h:944:
+ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1400: FILE: lib/eal/include/rte_bsd_queue.h:976:
+ (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1408: FILE: lib/eal/include/rte_bsd_queue.h:984:
+ ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL :^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1409: FILE: lib/eal/include/rte_bsd_queue.h:985:
+ __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))$
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#1468: FILE: lib/eal/include/rte_bsd_queue.h:1044:
+ QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxO)
#1469: FILE: lib/eal/include/rte_bsd_queue.h:1045:
+ QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1474: FILE: lib/eal/include/rte_bsd_queue.h:1050:
+ if ((swap_first = (head1)->tqh_first) != NULL) \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1478: FILE: lib/eal/include/rte_bsd_queue.h:1054:
+ if ((swap_first = (head2)->tqh_first) != NULL) \
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#1484: FILE: lib/eal/include/rte_bsd_queue.h:1060:
+#define TAILQ_END(head) NULL
total: 29 errors, 21 warnings, 1355 lines checked
Warning in lib/eal/include/rte_bsd_queue.h:
Writing to stdout or stderr
parent reply other threads:[~2025-11-03 16:52 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20251103164915.101713-3-stephen@networkplumber.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251103165126.B4CCE1261CB@dpdk.org \
--to=checkpatch@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=test-report@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).