From: Stephen Hemminger <stephen@networkplumber.org>
To: Weijun Pan <wpan3636@gmail.com>
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>,
Sachin Saxena <sachin.saxena@nxp.com>,
Jun Yang <jun.yang@nxp.com>,
dev@dpdk.org, Weijun Pan <wpan36@wisc.edu>,
stable@dpdk.org
Subject: Re: [PATCH] bus/fslmc: fix shadowed variables in queue storage macros
Date: Tue, 7 Apr 2026 07:09:49 -0700 [thread overview]
Message-ID: <20260407070940.225de771@phoenix.local> (raw)
In-Reply-To: <20260404171912.48947-1-wpan36@wisc.edu>
On Sat, 4 Apr 2026 12:19:11 -0500
Weijun Pan <wpan3636@gmail.com> wrote:
> 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; \
> } \
> } \
> } \
Why are these not inline functions.
Macros with lower case names are likely place fore confusion like this?
next prev parent reply other threads:[~2026-04-07 14:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 17:19 [PATCH] bus/fslmc: fix shadowed variables in queue storage macros Weijun Pan
2026-04-06 5:05 ` Hemant Agrawal
2026-04-07 14:09 ` Stephen Hemminger [this message]
2026-06-10 14:15 ` Thomas Monjalon
2026-06-11 14:11 ` David Marchand
-- 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=20260407070940.225de771@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=hemant.agrawal@nxp.com \
--cc=jun.yang@nxp.com \
--cc=sachin.saxena@nxp.com \
--cc=stable@dpdk.org \
--cc=wpan3636@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.