|WARNING| pw172259 [PATCH v5-S3 02/14] drivers: net/dpaa2 centralize devargs definitions

checkpatch at dpdk.org checkpatch at dpdk.org
Fri Oct 30 06:20:16 CET 2026


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

_coding style issues_


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

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

ERROR:COMPLEX_MACRO: Macros with complex values should be enclosed in parentheses
#241: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:54:
+#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_error_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) \
+	ENTRY("drv_strict_order", dpaa2_dev_args_set_strict_order, 0)

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?
#241: FILE: drivers/net/dpaa2/dpaa2_ethdev.c:54:
+#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_error_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) \
+	ENTRY("drv_strict_order", dpaa2_dev_args_set_strict_order, 0)

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


More information about the test-report mailing list