|WARNING| pw155932 [RFC 01/47] eal: add BSD version of queue.h
checkpatch at dpdk.org
checkpatch at dpdk.org
Tue Aug 19 01:32:13 CEST 2025
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/155932
_coding style issues_
WARNING:SPACING: space prohibited between function name and open parenthesis '('
#208: FILE: lib/eal/include/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
#221: FILE: lib/eal/include/bsd_queue.h:111:
+#define TRACEBUF struct qm_trace trace;
ERROR:SPACING: space prohibited before that ',' (ctx:WxE)
#222: FILE: lib/eal/include/bsd_queue.h:112:
+#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } ,
^
ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#222: FILE: lib/eal/include/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)
#247: FILE: lib/eal/include/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
#247: FILE: lib/eal/include/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
#256: FILE: lib/eal/include/bsd_queue.h:146:
+ defined(QUEUE_MACRO_NO_DEBUG_ASSERTIONS)$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#266: FILE: lib/eal/include/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
#267: FILE: lib/eal/include/bsd_queue.h:157:
+ (defined(_KERNEL) && defined(INVARIANTS))$
WARNING:SINGLE_STATEMENT_DO_WHILE_MACRO: Single statement macros should not use a do {} while (0) loop
#285: FILE: lib/eal/include/bsd_queue.h:175:
+#define QMD_PANIC(fmt, ...) do { \
+ panic(fmt, ##__VA_ARGS__); \
+} while (0)
WARNING:TYPO_SPELLING: 'stdio' may be misspelled - perhaps 'studio'?
#289: FILE: lib/eal/include/bsd_queue.h:179:
+#include <stdio.h>
^^^^^
WARNING:MACRO_ARG_UNUSED: Argument 'test' is not used in function-like macro
#307: FILE: lib/eal/include/bsd_queue.h:197:
+#define QMD_ASSERT(test, fmt, ...) do {} while (0)
WARNING:MACRO_ARG_UNUSED: Argument 'fmt' is not used in function-like macro
#307: FILE: lib/eal/include/bsd_queue.h:197:
+#define QMD_ASSERT(test, fmt, ...) do {} while (0)
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#334: FILE: lib/eal/include/bsd_queue.h:224:
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#365: FILE: lib/eal/include/bsd_queue.h:255:
+ QUEUE_TYPEOF(type) *_Curelm = SLIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#367: FILE: lib/eal/include/bsd_queue.h:257:
+ 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
#409: FILE: lib/eal/include/bsd_queue.h:299:
+#define SLIST_INIT(head) do { \
+ SLIST_FIRST((head)) = NULL; \
+} while (0)
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#430: FILE: lib/eal/include/bsd_queue.h:320:
+ QUEUE_TYPEOF(type) *_Curelm = SLIST_FIRST(head); \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#463: FILE: lib/eal/include/bsd_queue.h:353:
+ QUEUE_TYPEOF(type) *_Swap_first = SLIST_FIRST(head1); \
^
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#468: FILE: lib/eal/include/bsd_queue.h:358:
+#define SLIST_END(head) NULL
ERROR:SPACING: space required before the open parenthesis '('
#553: FILE: lib/eal/include/bsd_queue.h:443:
+ for((var) = STAILQ_FIRST((head)); \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#578: FILE: lib/eal/include/bsd_queue.h:468:
+ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#584: FILE: lib/eal/include/bsd_queue.h:474:
+ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#609: FILE: lib/eal/include/bsd_queue.h:499:
+ QUEUE_TYPEOF(type) *_Curelm = STAILQ_FIRST(head); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#618: FILE: lib/eal/include/bsd_queue.h:508:
+ if ((STAILQ_NEXT(elm, field) = \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#624: FILE: lib/eal/include/bsd_queue.h:514:
+ if ((STAILQ_FIRST((head)) = \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#644: FILE: lib/eal/include/bsd_queue.h:534:
+ QUEUE_TYPEOF(type) *_Swap_first = STAILQ_FIRST(head1); \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxO)
#645: FILE: lib/eal/include/bsd_queue.h:535:
+ QUEUE_TYPEOF(type) **_Swap_last = (head1)->stqh_last; \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#659: FILE: lib/eal/include/bsd_queue.h:549:
+ QUEUE_TYPEOF(type) *_Var, *_Varp, *_Varn; \
^
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#671: FILE: lib/eal/include/bsd_queue.h:561:
+#define STAILQ_END(head) NULL
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#688: FILE: lib/eal/include/bsd_queue.h:578:
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#750: FILE: lib/eal/include/bsd_queue.h:640:
+ QUEUE_TYPEOF(type) *_Curelm = LIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#752: FILE: lib/eal/include/bsd_queue.h:642:
+ 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
#793: FILE: lib/eal/include/bsd_queue.h:683:
+#define LIST_INIT(head) do { \
+ LIST_FIRST((head)) = NULL; \
+} while (0)
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#799: FILE: lib/eal/include/bsd_queue.h:689:
+ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#816: FILE: lib/eal/include/bsd_queue.h:706:
+ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#874: FILE: lib/eal/include/bsd_queue.h:764:
+ QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#877: FILE: lib/eal/include/bsd_queue.h:767:
+ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#879: FILE: lib/eal/include/bsd_queue.h:769:
+ if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#883: FILE: lib/eal/include/bsd_queue.h:773:
+#define LIST_END(head) NULL
WARNING:MACRO_ARG_UNUSED: Argument 'field' is not used in function-like macro
#942: FILE: lib/eal/include/bsd_queue.h:832:
+#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
#1042: FILE: lib/eal/include/bsd_queue.h:932:
+ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1067: FILE: lib/eal/include/bsd_queue.h:957:
+ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1099: FILE: lib/eal/include/bsd_queue.h:989:
+ (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
#1107: FILE: lib/eal/include/bsd_queue.h:997:
+ ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL :^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1108: FILE: lib/eal/include/bsd_queue.h:998:
+ __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1138: FILE: lib/eal/include/bsd_queue.h:1028:
+ TAILQ_NEXT((elm2), field)->field.tqe_prev =^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1138: FILE: lib/eal/include/bsd_queue.h:1028:
+ TAILQ_NEXT((elm2), field)->field.tqe_prev =^I^I\$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1139: FILE: lib/eal/include/bsd_queue.h:1029:
+ &(elm2)->field.tqe_next;^I^I^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1139: FILE: lib/eal/include/bsd_queue.h:1029:
+ &(elm2)->field.tqe_next;^I^I^I^I\$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1140: FILE: lib/eal/include/bsd_queue.h:1030:
+ else^I^I^I^I^I^I^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1140: FILE: lib/eal/include/bsd_queue.h:1030:
+ else^I^I^I^I^I^I^I^I\$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1141: FILE: lib/eal/include/bsd_queue.h:1031:
+ (head)->tqh_last = &(elm2)->field.tqe_next;^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1141: FILE: lib/eal/include/bsd_queue.h:1031:
+ (head)->tqh_last = &(elm2)->field.tqe_next;^I^I\$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1142: FILE: lib/eal/include/bsd_queue.h:1032:
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev;^I^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1142: FILE: lib/eal/include/bsd_queue.h:1032:
+ (elm2)->field.tqe_prev = (elm)->field.tqe_prev;^I^I^I\$
ERROR:CODE_INDENT: code indent should use tabs where possible
#1143: FILE: lib/eal/include/bsd_queue.h:1033:
+ *(elm2)->field.tqe_prev = (elm2);^I^I^I^I\$
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#1143: FILE: lib/eal/include/bsd_queue.h:1033:
+ *(elm2)->field.tqe_prev = (elm2);^I^I^I^I\$
ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#1167: FILE: lib/eal/include/bsd_queue.h:1057:
+ QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \
^
ERROR:SPACING: need consistent spacing around '*' (ctx:WxO)
#1168: FILE: lib/eal/include/bsd_queue.h:1058:
+ QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \
^
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1173: FILE: lib/eal/include/bsd_queue.h:1063:
+ if ((swap_first = (head1)->tqh_first) != NULL) \
ERROR:ASSIGN_IN_IF: do not use assignment in if condition
#1177: FILE: lib/eal/include/bsd_queue.h:1067:
+ if ((swap_first = (head2)->tqh_first) != NULL) \
WARNING:MACRO_ARG_UNUSED: Argument 'head' is not used in function-like macro
#1183: FILE: lib/eal/include/bsd_queue.h:1073:
+#define TAILQ_END(head) NULL
total: 35 errors, 28 warnings, 1082 lines checked
Warning in lib/eal/include/bsd_queue.h:
Writing to stdout or stderr
More information about the test-report
mailing list