|WARNING| pw149001 [PATCH v2 17/22] net/iavf: use common Tx queue mbuf cleanup fn

checkpatch at dpdk.org checkpatch at dpdk.org
Tue Dec 3 17:46:34 CET 2024


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

_coding style issues_


CHECK:MACRO_ARG_REUSE: Macro argument reuse 'swr' - possible side-effects?
#102: FILE: drivers/net/_common_intel/tx.h:274:
+#define IETH_FREE_BUFS_LOOP(swr, nb_desc, start, end) do { \
 		uint16_t i = start; \
+		if (end < i) { \
+			for (; i < nb_desc; i++) { \
 				rte_pktmbuf_free_seg(swr[i].mbuf); \
 				swr[i].mbuf = NULL; \
 			} \
 			i = 0; \
 		} \
+		for (; i < end; i++) { \
 			rte_pktmbuf_free_seg(swr[i].mbuf); \
 			swr[i].mbuf = NULL; \
 		} \
 } while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'nb_desc' may be better as '(nb_desc)' to avoid precedence issues
#102: FILE: drivers/net/_common_intel/tx.h:274:
+#define IETH_FREE_BUFS_LOOP(swr, nb_desc, start, end) do { \
 		uint16_t i = start; \
+		if (end < i) { \
+			for (; i < nb_desc; i++) { \
 				rte_pktmbuf_free_seg(swr[i].mbuf); \
 				swr[i].mbuf = NULL; \
 			} \
 			i = 0; \
 		} \
+		for (; i < end; i++) { \
 			rte_pktmbuf_free_seg(swr[i].mbuf); \
 			swr[i].mbuf = NULL; \
 		} \
 } while (0)

CHECK:MACRO_ARG_REUSE: Macro argument reuse 'end' - possible side-effects?
#102: FILE: drivers/net/_common_intel/tx.h:274:
+#define IETH_FREE_BUFS_LOOP(swr, nb_desc, start, end) do { \
 		uint16_t i = start; \
+		if (end < i) { \
+			for (; i < nb_desc; i++) { \
 				rte_pktmbuf_free_seg(swr[i].mbuf); \
 				swr[i].mbuf = NULL; \
 			} \
 			i = 0; \
 		} \
+		for (; i < end; i++) { \
 			rte_pktmbuf_free_seg(swr[i].mbuf); \
 			swr[i].mbuf = NULL; \
 		} \
 } while (0)

CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'end' may be better as '(end)' to avoid precedence issues
#102: FILE: drivers/net/_common_intel/tx.h:274:
+#define IETH_FREE_BUFS_LOOP(swr, nb_desc, start, end) do { \
 		uint16_t i = start; \
+		if (end < i) { \
+			for (; i < nb_desc; i++) { \
 				rte_pktmbuf_free_seg(swr[i].mbuf); \
 				swr[i].mbuf = NULL; \
 			} \
 			i = 0; \
 		} \
+		for (; i < end; i++) { \
 			rte_pktmbuf_free_seg(swr[i].mbuf); \
 			swr[i].mbuf = NULL; \
 		} \
 } while (0)

total: 0 errors, 0 warnings, 4 checks, 287 lines checked


More information about the test-report mailing list