igc: remove unreachable break after return in XDP path
Subsystems (3)
PATCH 1/1 igc: remove unreachable break after return in XDP path
The break statement after "return IGC_XDP_REDIRECT" in the XDP switch case is dead code since the return exits the function unconditionally. All other return statements in this switch are not followed by a break.
This was flagged by checkpatch.pl:
WARNING: break is not useful after a return
--- drivers/net/ethernet/intel/igc/igc_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_main.c +0 -1
@@ -2525,7 +2525,6 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter,if (xdp_do_redirect (adapter->netdev, xdp, prog) <0 ) goto out_failure;return IGC_XDP_REDIRECT ; -break ;default :bpf_warn_invalid_xdp_action (adapter->netdev, prog, act); fallthrough;
Signature · 1 line
2.55.0
Quoted 40 lines
-----Original Message-----
From: Keshav Goyal <[email protected]>
Sent: Wednesday, September 2, 2026 11:35 AM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Keshav Goyal <[email protected]>
Subject: [PATCH net-next] igc: remove unreachable break after return in XDP pathThe break statement after "return
IGC_XDP_REDIRECT" in the XDP switch case is dead code since the return exits the function unconditionally. All other return statements in this switch are not followed by a break.This was flagged by checkpatch.pl:
WARNING: break is not useful after a returnSigned-off-by Keshav Goyal <[email protected]>--- drivers/net/ethernet/intel/igc/igc_main.c | 1 - 1 file changed, 1 deletion(-)drivers/net/ethernet/intel/igc/igc_main.c +0
-1@@ -2525,7 +2525,6 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter, if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0) goto out_failure;return IGC_XDP_REDIRECT ; -break ;default :bpf_warn_invalid_xdp_action (adapter->netdev, prog, act);
Quoted 3 lines
fallthrough;
--
2.55.0
Kadosh, MoriyaX
Tested-byQuoted 37 lines · Aleksandr
Quoted 37 lines
-----Original Message-----
From: Keshav Goyal <[email protected]>
Sent: Wednesday, September 2, 2026 11:35 AM
To: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Keshav Goyal <[email protected]>
Subject: [PATCH net-next] igc: remove unreachable break after return in XDP pathThe break statement after "return
IGC_XDP_REDIRECT" in the XDP switch case is dead code since the return exits the function unconditionally. All other return statements in this switch are not followed by a break.This was flagged by checkpatch.pl:
WARNING: break is not useful after a returnSigned-off-by Keshav Goyal <[email protected]>--- drivers/net/ethernet/intel/igc/igc_main.c | 1 - 1 file changed, 1 deletion(-)drivers/net/ethernet/intel/igc/igc_main.c +0
-0@@ -2525,7 +2525,6 @@ static int __igc_xdp_run_prog(struct igc_adapter *adapter, if (xdp_do_redirect(adapter->netdev, xdp, prog) < 0) goto out_failure;return IGC_XDP_REDIRECT ;
Quoted 8 lines
Quoted 6 lines
drivers/net/ethernet/intel/igc/igc_main.c +0
-1-break ;default :bpf_warn_invalid_xdp_action (adapter->netdev, prog, act);fallthrough;
--
2.55.0Reviewed-by Aleksandr Loktionov <[email protected]>