|WARNING| pw171937 [PATCH v4-S3 18/65] net/dpaa2: unify xstats layout and add DPMAC counter struct
checkpatch at dpdk.org
checkpatch at dpdk.org
Fri Oct 23 15:51:45 CEST 2026
Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/171937
_coding style issues_
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'field' - possible side-effects?
#289: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:267:
+#define DPAA2_XSTAT_STR_SET(pg, field) \
+ .pg.field = (uint64_t)RTE_STR(field)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tc' - possible side-effects?
#292: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:270:
+#define DPAA2_XSTAT_TC_STR_SET(pg, tc, field) \
+ .pg[tc].field = (uint64_t)("TC" RTE_STR(tc)"_" RTE_STR(field))
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'field' - possible side-effects?
#292: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:270:
+#define DPAA2_XSTAT_TC_STR_SET(pg, tc, field) \
+ .pg[tc].field = (uint64_t)("TC" RTE_STR(tc)"_" RTE_STR(field))
ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#295: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:273:
+#define DPAA2_XSTAT_TC_COLOR_STR_SET(pg, tc) \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_yellow), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_green), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_yellow)
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.
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'pg' - possible side-effects?
#295: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:273:
+#define DPAA2_XSTAT_TC_COLOR_STR_SET(pg, tc) \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_yellow), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_green), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_yellow)
CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tc' - possible side-effects?
#295: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:273:
+#define DPAA2_XSTAT_TC_COLOR_STR_SET(pg, tc) \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_yellow), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_green), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_red), \
+ DPAA2_XSTAT_TC_STR_SET(pg, tc, policer_cnt_re_yellow)
WARNING:LONG_LINE: line length of 103 exceeds 100 columns
#640: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:2440:
+ rte_strscpy(xstats_names[i].name, (char *)xstat_str[ids[i]], RTE_ETH_XSTATS_NAME_SIZE);
total: 1 errors, 1 warnings, 5 checks, 800 lines checked
Warning in drivers/net/dpaa2/dpaa2_ethdev.c:
Using %l format, prefer %PRI*64 if type is [u]int64_t
More information about the test-report
mailing list