|WARNING| pw171921 [PATCH v4-S3 02/65] net/dpaa2: generate devargs table and string from one list

checkpatch at dpdk.org checkpatch at dpdk.org
Fri Oct 23 15:45:26 CEST 2026


Test-Label: checkpatch
Test-Status: WARNING
http://dpdk.org/patch/171921

_coding style issues_


WARNING:MACRO_ARG_UNUSED: Argument 'handle' is not used in function-like macro
#122: FILE: drivers/common/dpaax/dpaax_devarg.h:37:
+#define DPAAX_DEVARG_STRING_ENTRY(key, handle, flag) key "=<int> "

WARNING:MACRO_ARG_UNUSED: Argument 'flag' is not used in function-like macro
#122: FILE: drivers/common/dpaax/dpaax_devarg.h:37:
+#define DPAAX_DEVARG_STRING_ENTRY(key, handle, flag) key "=<int> "

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#172: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:43:
+#define DPAA2_DEVARGS(ENTRY) \
+	ENTRY("drv_loopback", NULL, DPAA2_RX_LOOPBACK_MODE) \
+	ENTRY("drv_no_prefetch", NULL, DPAA2_NO_PREFETCH_RX) \
+	ENTRY("drv_tx_conf", NULL, DPAA2_TX_CONF_ENABLE) \
+	ENTRY("drv_rx_parse_drop", NULL, DPAA2_PARSE_ERR_DROP) \
+	ENTRY("drv_rx_print_parser_result", NULL, DPAA2_RX_PRINT_PSR_RESULT_FLAG) \
+	ENTRY("drv_err_queue", NULL, DPAA2_RX_ERROR_QUEUE_FLAG) \
+	ENTRY("drv_no_taildrop", NULL, DPAA2_RX_TAILDROP_OFF) \
+	ENTRY("drv_no_data_stashing", NULL, DPAA2_RX_DATA_STASHING_OFF_FLAG)

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 'ENTRY' - possible side-effects?
#172: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:43:
+#define DPAA2_DEVARGS(ENTRY) \
+	ENTRY("drv_loopback", NULL, DPAA2_RX_LOOPBACK_MODE) \
+	ENTRY("drv_no_prefetch", NULL, DPAA2_NO_PREFETCH_RX) \
+	ENTRY("drv_tx_conf", NULL, DPAA2_TX_CONF_ENABLE) \
+	ENTRY("drv_rx_parse_drop", NULL, DPAA2_PARSE_ERR_DROP) \
+	ENTRY("drv_rx_print_parser_result", NULL, DPAA2_RX_PRINT_PSR_RESULT_FLAG) \
+	ENTRY("drv_err_queue", NULL, DPAA2_RX_ERROR_QUEUE_FLAG) \
+	ENTRY("drv_no_taildrop", NULL, DPAA2_RX_TAILDROP_OFF) \
+	ENTRY("drv_no_data_stashing", NULL, DPAA2_RX_DATA_STASHING_OFF_FLAG)

total: 1 errors, 2 warnings, 1 checks, 283 lines checked


More information about the test-report mailing list