[PATCH] bus/fslmc: fix shadowed variables in queue storage macros

Weijun Pan wpan3636 at gmail.com
Sat Apr 4 19:19:11 CEST 2026


The queue storage allocation and free macros declare local variables
named ret and i, which shadow local variables in
rte_dpaa2_create_dpci_device() and trigger -Wshadow warnings.

Rename the macro-local variables to avoid shadowing without changing
behavior.

Bugzilla ID: 1744
Fixes: 12d98eceb8ac ("bus/fslmc: enhance QBMAN DQ storage logic")
Cc: jun.yang at nxp.com
Cc: stable at dpdk.org

Signed-off-by: Weijun Pan <wpan36 at wisc.edu>
---
 drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 28 ++++++++++++-------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
index e625a5c035..bbeccd8fc3 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
@@ -204,33 +204,33 @@ struct swp_active_dqs {
 
 #define dpaa2_queue_storage_alloc(q, num) \
 ({ \
-	int ret = 0, i; \
+	int qs_ret = 0, qs_idx; \
 	\
-	for (i = 0; i < (num); i++) { \
-		(q)->q_storage[i] = rte_zmalloc(NULL, \
+	for (qs_idx = 0; qs_idx < (num); qs_idx++) { \
+		(q)->q_storage[qs_idx] = rte_zmalloc(NULL, \
 			sizeof(struct queue_storage_info_t), \
 			RTE_CACHE_LINE_SIZE); \
-		if (!(q)->q_storage[i]) { \
-			ret = -ENOBUFS; \
+		if (!(q)->q_storage[qs_idx]) { \
+			qs_ret = -ENOBUFS; \
 			break; \
 		} \
-		ret = dpaa2_alloc_dq_storage((q)->q_storage[i]); \
-		if (ret) \
+		qs_ret = dpaa2_alloc_dq_storage((q)->q_storage[qs_idx]); \
+		if (qs_ret) \
 			break; \
 	} \
-	ret; \
+	qs_ret; \
 })
 
 #define dpaa2_queue_storage_free(q, num) \
 ({ \
 	if (q) { \
-		int i; \
+		int qs_idx; \
 		\
-		for (i = 0; i < (num); i++) { \
-			if ((q)->q_storage[i]) { \
-				dpaa2_free_dq_storage((q)->q_storage[i]); \
-				rte_free((q)->q_storage[i]); \
-				(q)->q_storage[i] = NULL; \
+		for (qs_idx = 0; qs_idx < (num); qs_idx++) { \
+			if ((q)->q_storage[qs_idx]) { \
+				dpaa2_free_dq_storage((q)->q_storage[qs_idx]); \
+				rte_free((q)->q_storage[qs_idx]); \
+				(q)->q_storage[qs_idx] = NULL; \
 			} \
 		} \
 	} \
-- 
2.34.1



More information about the stable mailing list