Subject: Re: [PATCH net-next 2/2] netdev_queues: fix -Wshadow / Sparse shadow warnings throughout the file

From: Jakub Kicinski <[email-masked]>
Date: Fri, 29 Mar 2024 13:18:57 -0700

On Fri, 29 Mar 2024 18:00:00 +0100 Alexander Lobakin wrote:
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:1992:9: warning: declaration shadows a local variable [-Wshadow]
>  1992 |         return netif_txq_maybe_stop(nq, IDPF_DESC_UNUSED(tx_q), size, size);
>       |                ^
> ./include/net/netdev_queues.h:137:11: note: expanded from macro 'netif_txq_maybe_stop'
>   137 |                         _res = netif_txq_try_stop(txq, get_desc, start_thrs); \
>       |                                ^
> ./include/net/netdev_queues.h:92:7: note: expanded from macro 'netif_txq_try_stop'
>    92 |                 int _res;                                               \
>       |                     ^
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:1992:9: note: previous declaration is here
> ./include/net/netdev_queues.h:133:7: note: expanded from macro 'netif_txq_maybe_stop'
>   133 |                 int _res;                                               \
>       |                     ^
> 
> Sparse:
> 
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:1992:16: warning: symbol '_res' shadows an earlier one
> drivers/net/ethernet/intel/idpf/idpf_txrx.c:1992:16: originally declared here

I don't see these building with LLVM=1 W=12 C=1
and I really don't like complicating the code because the compiler
is stupid. Can't you solve this with some renames? Add another
underscore or something?

---

From: Jakub Kicinski <[email-masked]>
Date: Fri, 29 Mar 2024 13:18:57 -0700

DKIM-Filter: OpenDKIM Filter v2.11.0 b.mx.secunet.com 82B0520270
Date: Fri, 29 Mar 2024 13:18:57 -0700
From: Jakub Kicinski <[email-masked]>
To: Alexander Lobakin <[email-masked]>
Cc: "David S. Miller" <[email-masked]>, Eric Dumazet
 <[email-masked]>, Paolo Abeni <[email-masked]>, Dmitry Safonov
 <[email-masked]>, Heiner Kallweit <[email-masked]>,
 [email-masked], [email-masked],
 [email-masked]
Subject: Re: [PATCH net-next 2/2] netdev_queues: fix -Wshadow / Sparse
 shadow warnings throughout the file

DKIM-Filter: OpenDKIM Filter v2.11.0 b.mx.secunet.com 0140A202E4
Date: Fri, 29 Mar 2024 13:18:57 -0700
From: Jakub Kicinski <[email-masked]>
To: Alexander Lobakin <[email-masked]>
Cc: "David S. Miller" <[email-masked]>, Eric Dumazet
 <[email-masked]>, Paolo Abeni <[email-masked]>, Dmitry Safonov
 <[email-masked]>, Heiner Kallweit <[email-masked]>,
 [email-masked], [email-masked],
 [email-masked]
Subject: Re: [PATCH net-next 2/2] netdev_queues: fix -Wshadow / Sparse
 shadow warnings throughout the file