* [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf()
@ 2026-08-24 7:09 Muhammad Falak R Wani
2026-08-24 14:21 ` Hamza Mahfooz
2026-08-25 10:00 ` Paolo Abeni
0 siblings, 2 replies; 4+ messages in thread
From: Muhammad Falak R Wani @ 2026-08-24 7:09 UTC (permalink / raw)
To: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni
Cc: linux-hyperv, netdev, linux-kernel, bpf
mana_bpf() declares an uninitialized 'ret' and falls through to a
trailing 'return ret;' after a switch statement whose every case
(XDP_SETUP_PROG and default) already returns unconditionally. This
statement is therefore unreachable dead code left over from an
earlier refactor, and it would return an uninitialized value if it
were ever reached.
Drop the unused variable and the unreachable return.
Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
---
drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
index 53308e139cbe9..70bb8c9dc3413 100644
--- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
+++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
@@ -253,7 +253,6 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,
int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
{
struct netlink_ext_ack *extack = bpf->extack;
- int ret;
switch (bpf->command) {
case XDP_SETUP_PROG:
@@ -262,6 +261,4 @@ int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
default:
return -EOPNOTSUPP;
}
-
- return ret;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf()
2026-08-24 7:09 [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf() Muhammad Falak R Wani
@ 2026-08-24 14:21 ` Hamza Mahfooz
2026-08-25 10:03 ` Paolo Abeni
2026-08-25 10:00 ` Paolo Abeni
1 sibling, 1 reply; 4+ messages in thread
From: Hamza Mahfooz @ 2026-08-24 14:21 UTC (permalink / raw)
To: Muhammad Falak R Wani
Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, linux-hyperv, netdev, linux-kernel, bpf
On Mon, Aug 24, 2026 at 12:39:06PM +0530, Muhammad Falak R Wani wrote:
> mana_bpf() declares an uninitialized 'ret' and falls through to a
> trailing 'return ret;' after a switch statement whose every case
> (XDP_SETUP_PROG and default) already returns unconditionally. This
> statement is therefore unreachable dead code left over from an
> earlier refactor, and it would return an uninitialized value if it
> were ever reached.
>
> Drop the unused variable and the unreachable return.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Fixes: ed5356b53f07 ("net: mana: Add XDP support")
Reviewed-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
> ---
> drivers/net/ethernet/microsoft/mana/mana_bpf.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_bpf.c b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> index 53308e139cbe9..70bb8c9dc3413 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_bpf.c
> @@ -253,7 +253,6 @@ static int mana_xdp_set(struct net_device *ndev, struct bpf_prog *prog,
> int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
> {
> struct netlink_ext_ack *extack = bpf->extack;
> - int ret;
>
> switch (bpf->command) {
> case XDP_SETUP_PROG:
> @@ -262,6 +261,4 @@ int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf)
> default:
> return -EOPNOTSUPP;
> }
> -
> - return ret;
> }
> --
> 2.55.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf()
2026-08-24 7:09 [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf() Muhammad Falak R Wani
2026-08-24 14:21 ` Hamza Mahfooz
@ 2026-08-25 10:00 ` Paolo Abeni
1 sibling, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2026-08-25 10:00 UTC (permalink / raw)
To: Muhammad Falak R Wani, K. Y. Srinivasan, Haiyang Zhang, Wei Liu,
Dexuan Cui, Long Li, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski
Cc: linux-hyperv, netdev, linux-kernel, bpf
On 8/24/26 9:09 AM, Muhammad Falak R Wani wrote:
> mana_bpf() declares an uninitialized 'ret' and falls through to a
> trailing 'return ret;' after a switch statement whose every case
> (XDP_SETUP_PROG and default) already returns unconditionally. This
> statement is therefore unreachable dead code left over from an
> earlier refactor, and it would return an uninitialized value if it
> were ever reached.
>
> Drop the unused variable and the unreachable return.
>
> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
## Form letter - net-next-closed
net-next pull request for v7.3 has already been merged, and therefore
the net-next tree is closed for new drivers, features, code refactoring
and optimizations. We are currently accepting bug fixes only.
Please repost when net-next reopens after Aug 31st.
RFC patches sent for review only are obviously welcome at any time.
See:
https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
--
pw-bot: defer
pv-bot: closed
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf()
2026-08-24 14:21 ` Hamza Mahfooz
@ 2026-08-25 10:03 ` Paolo Abeni
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Abeni @ 2026-08-25 10:03 UTC (permalink / raw)
To: Hamza Mahfooz, Muhammad Falak R Wani
Cc: K. Y. Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
linux-hyperv, netdev, linux-kernel, bpf
On 8/24/26 4:21 PM, Hamza Mahfooz wrote:
> On Mon, Aug 24, 2026 at 12:39:06PM +0530, Muhammad Falak R Wani wrote:
>> mana_bpf() declares an uninitialized 'ret' and falls through to a
>> trailing 'return ret;' after a switch statement whose every case
>> (XDP_SETUP_PROG and default) already returns unconditionally. This
>> statement is therefore unreachable dead code left over from an
>> earlier refactor, and it would return an uninitialized value if it
>> were ever reached.
>>
>> Drop the unused variable and the unreachable return.
>>
>> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
>
> Fixes: ed5356b53f07 ("net: mana: Add XDP support")
> Reviewed-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Please note that the current guidance is no fixes tag for net-next changes.
Also this specific change does not address any real issue, it's just
code cleanup.
/P
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-25 10:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-24 7:09 [PATCH net-next] net: mana: remove unreachable dead code in mana_bpf() Muhammad Falak R Wani
2026-08-24 14:21 ` Hamza Mahfooz
2026-08-25 10:03 ` Paolo Abeni
2026-08-25 10:00 ` Paolo Abeni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox