public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
* [PATCH 0/2] More fixes after enabling -Wshadow
@ 2026-01-21 11:05 Thomas Monjalon
  2026-01-21 11:06 ` [PATCH 1/2] common/mlx5: fix variable shadowing Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Thomas Monjalon @ 2026-01-21 11:05 UTC (permalink / raw)
  To: dev; +Cc: bruce.richardson, david.marchand

The drivers mvpp2 and mlx5 for Windows
were not checked when enabling -Wshadow.
Here are the missing small fixes.

Thomas Monjalon (2):
  common/mlx5: fix variable shadowing
  net/mvpp2: fix variable shadowing

 drivers/common/mlx5/windows/mlx5_glue.h | 2 +-
 drivers/net/mvpp2/mrvl_ethdev.c         | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

-- 
2.52.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] common/mlx5: fix variable shadowing
  2026-01-21 11:05 [PATCH 0/2] More fixes after enabling -Wshadow Thomas Monjalon
@ 2026-01-21 11:06 ` Thomas Monjalon
  2026-01-21 11:11   ` David Marchand
  2026-01-21 11:06 ` [PATCH 2/2] net/mvpp2: " Thomas Monjalon
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2026-01-21 11:06 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, david.marchand, stable, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Ophir Munk

The word "unused" is too common for being used in a header.
There is a warning because a parameter is named "unused" in mbuf:

lib/mbuf/rte_mbuf.h: In function 'rte_mbuf_tx_offload':
error: declaration of 'unused' shadows a previous local [-Werror=shadow]
 1910 |         uint64_t ol3, uint64_t ol2, uint64_t unused)
      |                                     ~~~~~~~~~^~~~~~

Such value should be prefixed with "MLX5".

Fixes: bd935fe3e624 ("net/mlx5: wrap sampling actions per OS")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/common/mlx5/windows/mlx5_glue.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/common/mlx5/windows/mlx5_glue.h b/drivers/common/mlx5/windows/mlx5_glue.h
index 5ba324ebc4..f53142e3d4 100644
--- a/drivers/common/mlx5/windows/mlx5_glue.h
+++ b/drivers/common/mlx5/windows/mlx5_glue.h
@@ -16,7 +16,7 @@
 #endif
 
 #ifndef HAVE_MLX5DV_DR
-enum  mlx5dv_dr_domain_type { unused, };
+enum  mlx5dv_dr_domain_type { MLX5_UNUSED_DOMAIN_TYPE };
 struct mlx5dv_dr_domain;
 struct mlx5dv_dr_action;
 #endif
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] net/mvpp2: fix variable shadowing
  2026-01-21 11:05 [PATCH 0/2] More fixes after enabling -Wshadow Thomas Monjalon
  2026-01-21 11:06 ` [PATCH 1/2] common/mlx5: fix variable shadowing Thomas Monjalon
@ 2026-01-21 11:06 ` Thomas Monjalon
  2026-01-21 11:11   ` David Marchand
  2026-01-21 11:12 ` [PATCH 0/2] More fixes after enabling -Wshadow Bruce Richardson
  2026-01-21 14:37 ` David Marchand
  3 siblings, 1 reply; 7+ messages in thread
From: Thomas Monjalon @ 2026-01-21 11:06 UTC (permalink / raw)
  To: dev
  Cc: bruce.richardson, david.marchand, stable, Liron Himi, Jacek Siuda,
	Tomasz Duszynski

With shadowing warning enabled, we can see "i" was declared twice:

drivers/net/mvpp2/mrvl_ethdev.c: In function 'mrvl_rx_pkt_burst':
error: declaration of 'i' shadows a previous local [-Werror=shadow]
 2676 |                         int i;
      |                             ^
/mrvl_ethdev.c:2592:13: note: shadowed declaration is here
 2592 |         int i, ret, rx_done = 0;
      |             ^

Fixes: afb4d0d0bf91 ("net/mrvl: add Rx/Tx support")
Cc: stable@dpdk.org

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index 845819e4d8..1074092d43 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -2673,7 +2673,6 @@ mrvl_rx_pkt_burst(void *rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 			     (!rx_done && num < q->priv->bpool_init_size))) {
 			mrvl_fill_bpool(q, q->priv->fill_bpool_buffs);
 		} else if (unlikely(num > q->priv->bpool_max_size)) {
-			int i;
 			int pkt_to_remove = num - q->priv->bpool_init_size;
 			struct rte_mbuf *mbuf;
 			struct pp2_buff_inf buff;
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] common/mlx5: fix variable shadowing
  2026-01-21 11:06 ` [PATCH 1/2] common/mlx5: fix variable shadowing Thomas Monjalon
@ 2026-01-21 11:11   ` David Marchand
  0 siblings, 0 replies; 7+ messages in thread
From: David Marchand @ 2026-01-21 11:11 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, bruce.richardson, stable, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Ophir Munk

On Wed, 21 Jan 2026 at 12:08, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The word "unused" is too common for being used in a header.
> There is a warning because a parameter is named "unused" in mbuf:
>
> lib/mbuf/rte_mbuf.h: In function 'rte_mbuf_tx_offload':
> error: declaration of 'unused' shadows a previous local [-Werror=shadow]
>  1910 |         uint64_t ol3, uint64_t ol2, uint64_t unused)
>       |                                     ~~~~~~~~~^~~~~~
>
> Such value should be prefixed with "MLX5".
>
> Fixes: bd935fe3e624 ("net/mlx5: wrap sampling actions per OS")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] net/mvpp2: fix variable shadowing
  2026-01-21 11:06 ` [PATCH 2/2] net/mvpp2: " Thomas Monjalon
@ 2026-01-21 11:11   ` David Marchand
  0 siblings, 0 replies; 7+ messages in thread
From: David Marchand @ 2026-01-21 11:11 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: dev, bruce.richardson, stable, Liron Himi, Jacek Siuda,
	Tomasz Duszynski

On Wed, 21 Jan 2026 at 12:08, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> With shadowing warning enabled, we can see "i" was declared twice:
>
> drivers/net/mvpp2/mrvl_ethdev.c: In function 'mrvl_rx_pkt_burst':
> error: declaration of 'i' shadows a previous local [-Werror=shadow]
>  2676 |                         int i;
>       |                             ^
> /mrvl_ethdev.c:2592:13: note: shadowed declaration is here
>  2592 |         int i, ret, rx_done = 0;
>       |             ^
>
> Fixes: afb4d0d0bf91 ("net/mrvl: add Rx/Tx support")
> Cc: stable@dpdk.org
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] More fixes after enabling -Wshadow
  2026-01-21 11:05 [PATCH 0/2] More fixes after enabling -Wshadow Thomas Monjalon
  2026-01-21 11:06 ` [PATCH 1/2] common/mlx5: fix variable shadowing Thomas Monjalon
  2026-01-21 11:06 ` [PATCH 2/2] net/mvpp2: " Thomas Monjalon
@ 2026-01-21 11:12 ` Bruce Richardson
  2026-01-21 14:37 ` David Marchand
  3 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2026-01-21 11:12 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, david.marchand

On Wed, Jan 21, 2026 at 12:05:59PM +0100, Thomas Monjalon wrote:
> The drivers mvpp2 and mlx5 for Windows
> were not checked when enabling -Wshadow.
> Here are the missing small fixes.
> 
> Thomas Monjalon (2):
>   common/mlx5: fix variable shadowing
>   net/mvpp2: fix variable shadowing
> 
>  drivers/common/mlx5/windows/mlx5_glue.h | 2 +-
>  drivers/net/mvpp2/mrvl_ethdev.c         | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
Thanks Thomas.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] More fixes after enabling -Wshadow
  2026-01-21 11:05 [PATCH 0/2] More fixes after enabling -Wshadow Thomas Monjalon
                   ` (2 preceding siblings ...)
  2026-01-21 11:12 ` [PATCH 0/2] More fixes after enabling -Wshadow Bruce Richardson
@ 2026-01-21 14:37 ` David Marchand
  3 siblings, 0 replies; 7+ messages in thread
From: David Marchand @ 2026-01-21 14:37 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, bruce.richardson

On Wed, 21 Jan 2026 at 12:08, Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The drivers mvpp2 and mlx5 for Windows
> were not checked when enabling -Wshadow.
> Here are the missing small fixes.
>
> Thomas Monjalon (2):
>   common/mlx5: fix variable shadowing
>   net/mvpp2: fix variable shadowing
>
>  drivers/common/mlx5/windows/mlx5_glue.h | 2 +-
>  drivers/net/mvpp2/mrvl_ethdev.c         | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)

Series applied, merci Thomas.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-21 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-21 11:05 [PATCH 0/2] More fixes after enabling -Wshadow Thomas Monjalon
2026-01-21 11:06 ` [PATCH 1/2] common/mlx5: fix variable shadowing Thomas Monjalon
2026-01-21 11:11   ` David Marchand
2026-01-21 11:06 ` [PATCH 2/2] net/mvpp2: " Thomas Monjalon
2026-01-21 11:11   ` David Marchand
2026-01-21 11:12 ` [PATCH 0/2] More fixes after enabling -Wshadow Bruce Richardson
2026-01-21 14:37 ` David Marchand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox