From: Weijun Pan <wpan3636@gmail.com>
To: Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Jun Yang <jun.yang@nxp.com>
Cc: dev@dpdk.org, Weijun Pan <wpan36@wisc.edu>, stable@dpdk.org
Subject: [PATCH] bus/fslmc: fix shadowed variables in queue storage macros
Date: Sat, 4 Apr 2026 12:19:11 -0500 [thread overview]
Message-ID: <20260404171912.48947-1-wpan36@wisc.edu> (raw)
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@nxp.com
Cc: stable@dpdk.org
Signed-off-by: Weijun Pan <wpan36@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
next reply other threads:[~2026-04-07 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 17:19 Weijun Pan [this message]
2026-04-06 5:05 ` [PATCH] bus/fslmc: fix shadowed variables in queue storage macros Hemant Agrawal
2026-04-07 14:09 ` Stephen Hemminger
-- strict thread matches above, loose matches on Subject: below --
2026-04-07 14:19 Weijun Pan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260404171912.48947-1-wpan36@wisc.edu \
--to=wpan3636@gmail.com \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jun.yang@nxp.com \
--cc=sachin.saxena@nxp.com \
--cc=stable@dpdk.org \
--cc=wpan36@wisc.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox