* [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns with no effect
@ 2026-07-25 15:08 Sang-Heon Jeon
2026-07-25 15:08 ` [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return " Sang-Heon Jeon
2026-07-30 11:10 ` [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns " patchwork-bot+netdevbpf
0 siblings, 2 replies; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 15:08 UTC (permalink / raw)
To: kuba, Andrew Lunn, Andrew Lunn, Arkadiusz Kubalewski,
Arthur Kiyanovski, Arun Ramadoss, Claudiu Manoil, David Arinzon,
David S. Miller, Eric Dumazet, Heiner Kallweit, Ioana Ciornei,
Ivan Vecera, Jiri Pirko, Kory Maincent, Manish Chopra,
Niklas Söderlund, Oleksij Rempel, Paolo Abeni,
Prathosh Satish, Przemek Kitszel, Rahul Verma, Sabrina Dubroca,
Shahed Shaikh, Sukhdeep Singh, Tony Nguyen, Vadim Fedorenko
Cc: GR-Linux-NIC-Dev, intel-wired-lan, linux-kernel,
linux-renesas-soc, netdev, Russell King, UNGLinuxDriver
Hello,
This series removes conditional returns where both branches return
the same value, so the check has no effect. As suggested by Jakub, the
netdev patches of the treewide v1 series [1] are posted separately.
All patches are generated by the Coccinelle script, which you can
find in v1.
The patch grouping is unchanged from v1. If you would rather split,
merge or drop any of the patches, just let me know and I will address
it in the next version.
---
Changes from v1 [1]
- Collect Reviewed-by tags
- Change base to net-next/main
- Filter only netdev patches
[1] https://lore.kernel.org/all/20260723184538.3888637-1-ekffu200098@gmail.com/
---
Sang-Heon Jeon (4):
dpll: zl3073x: remove conditional return with no effect
net: ethernet: remove conditional return with no effect
net: remove conditional return with no effect
net: intel: remove conditional return with no effect
drivers/dpll/zl3073x/dpll.c | 6 +-----
drivers/dpll/zl3073x/out.c | 8 ++------
drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +-----
drivers/net/ethernet/aquantia/atlantic/aq_macsec.c | 6 +-----
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 6 +-----
drivers/net/ethernet/freescale/gianfar.c | 6 +-----
drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +-------
drivers/net/ethernet/intel/igb/e1000_i210.c | 6 +-----
drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 7 +------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 6 +-----
drivers/net/ethernet/renesas/rtsn.c | 7 +------
drivers/net/phy/microchip_t1.c | 6 +-----
drivers/net/pse-pd/tps23881.c | 6 +-----
14 files changed, 15 insertions(+), 75 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return with no effect
2026-07-25 15:08 [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns with no effect Sang-Heon Jeon
@ 2026-07-25 15:08 ` Sang-Heon Jeon
2026-07-27 9:45 ` Marcin Szycik
2026-07-30 11:10 ` [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns " patchwork-bot+netdevbpf
1 sibling, 1 reply; 4+ messages in thread
From: Sang-Heon Jeon @ 2026-07-25 15:08 UTC (permalink / raw)
To: kuba, Tony Nguyen, Przemek Kitszel, Andrew Lunn, David S. Miller,
Eric Dumazet, Paolo Abeni
Cc: intel-wired-lan, linux-kernel, netdev
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.
This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.
Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +-------
drivers/net/ethernet/intel/igb/e1000_i210.c | 6 +-----
drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
3 files changed, 3 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a04683004a56..0cd0e5597c90 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -4864,16 +4864,10 @@ static void i40e_control_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
**/
int i40e_control_wait_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
{
- int ret = 0;
-
i40e_control_rx_q(pf, pf_q, enable);
/* wait for the change to finish */
- ret = i40e_pf_rxq_wait(pf, pf_q, enable);
- if (ret)
- return ret;
-
- return ret;
+ return i40e_pf_rxq_wait(pf, pf_q, enable);
}
/**
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c
index 9db29b231d6a..784f9a7bcbed 100644
--- a/drivers/net/ethernet/intel/igb/e1000_i210.c
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.c
@@ -756,11 +756,7 @@ static s32 __igb_access_xmdio_reg(struct e1000_hw *hw, u16 address,
return ret_val;
/* Recalibrate the device back to 0 */
- ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0);
- if (ret_val)
- return ret_val;
-
- return ret_val;
+ return hw->phy.ops.write_reg(hw, E1000_MMDAC, 0);
}
/**
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 4cf737fb3b21..b758a7e0f013 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -675,11 +675,7 @@ static s32 __igc_access_xmdio_reg(struct igc_hw *hw, u16 address,
return ret_val;
/* Recalibrate the device back to 0 */
- ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, 0);
- if (ret_val)
- return ret_val;
-
- return ret_val;
+ return hw->phy.ops.write_reg(hw, IGC_MMDAC, 0);
}
/**
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return with no effect
2026-07-25 15:08 ` [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return " Sang-Heon Jeon
@ 2026-07-27 9:45 ` Marcin Szycik
0 siblings, 0 replies; 4+ messages in thread
From: Marcin Szycik @ 2026-07-27 9:45 UTC (permalink / raw)
To: Sang-Heon Jeon, kuba, Tony Nguyen, Przemek Kitszel, Andrew Lunn,
David S. Miller, Eric Dumazet, Paolo Abeni
Cc: intel-wired-lan, linux-kernel, netdev
On 25/07/2026 17:08, Sang-Heon Jeon wrote:
> Both branches of the check return the same value, so the check has
> no effect. Remove it and return the value directly.
>
> This is the result of running the Coccinelle script from
> scripts/coccinelle/misc/cond_return_no_effect.cocci.
>
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
Nice cleanup.
Reviewed-by: Marcin Szycik <marcin.szycik@linux.intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +-------
> drivers/net/ethernet/intel/igb/e1000_i210.c | 6 +-----
> drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
> 3 files changed, 3 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
> index a04683004a56..0cd0e5597c90 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_main.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
> @@ -4864,16 +4864,10 @@ static void i40e_control_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
> **/
> int i40e_control_wait_rx_q(struct i40e_pf *pf, int pf_q, bool enable)
> {
> - int ret = 0;
> -
> i40e_control_rx_q(pf, pf_q, enable);
>
> /* wait for the change to finish */
> - ret = i40e_pf_rxq_wait(pf, pf_q, enable);
> - if (ret)
> - return ret;
> -
> - return ret;
> + return i40e_pf_rxq_wait(pf, pf_q, enable);
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c
> index 9db29b231d6a..784f9a7bcbed 100644
> --- a/drivers/net/ethernet/intel/igb/e1000_i210.c
> +++ b/drivers/net/ethernet/intel/igb/e1000_i210.c
> @@ -756,11 +756,7 @@ static s32 __igb_access_xmdio_reg(struct e1000_hw *hw, u16 address,
> return ret_val;
>
> /* Recalibrate the device back to 0 */
> - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0);
> - if (ret_val)
> - return ret_val;
> -
> - return ret_val;
> + return hw->phy.ops.write_reg(hw, E1000_MMDAC, 0);
> }
>
> /**
> diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
> index 4cf737fb3b21..b758a7e0f013 100644
> --- a/drivers/net/ethernet/intel/igc/igc_phy.c
> +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
> @@ -675,11 +675,7 @@ static s32 __igc_access_xmdio_reg(struct igc_hw *hw, u16 address,
> return ret_val;
>
> /* Recalibrate the device back to 0 */
> - ret_val = hw->phy.ops.write_reg(hw, IGC_MMDAC, 0);
> - if (ret_val)
> - return ret_val;
> -
> - return ret_val;
> + return hw->phy.ops.write_reg(hw, IGC_MMDAC, 0);
> }
>
> /**
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns with no effect
2026-07-25 15:08 [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 15:08 ` [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return " Sang-Heon Jeon
@ 2026-07-30 11:10 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-07-30 11:10 UTC (permalink / raw)
To: Sang-Heon Jeon
Cc: kuba, andrew, andrew+netdev, arkadiusz.kubalewski, akiyano,
arun.ramadoss, claudiu.manoil, darinzon, davem, edumazet,
hkallweit1, ioana.ciornei, ivecera, jiri, kory.maincent, manishc,
niklas.soderlund, o.rempel, pabeni, Prathosh.Satish,
przemyslaw.kitszel, rahulv, sd, shshaikh, sukhdeeps,
anthony.l.nguyen, vadim.fedorenko, GR-Linux-NIC-Dev,
intel-wired-lan, linux-kernel, linux-renesas-soc, netdev, linux,
UNGLinuxDriver
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Sun, 26 Jul 2026 00:08:48 +0900 you wrote:
> Hello,
>
> This series removes conditional returns where both branches return
> the same value, so the check has no effect. As suggested by Jakub, the
> netdev patches of the treewide v1 series [1] are posted separately.
>
> All patches are generated by the Coccinelle script, which you can
> find in v1.
>
> [...]
Here is the summary with links:
- [net-next,v2,1/4] dpll: zl3073x: remove conditional return with no effect
https://git.kernel.org/netdev/net-next/c/87579b8cda9e
- [net-next,v2,2/4] net: ethernet: remove conditional return with no effect
https://git.kernel.org/netdev/net-next/c/66084e9510a9
- [net-next,v2,3/4] net: remove conditional return with no effect
https://git.kernel.org/netdev/net-next/c/cd833378bafa
- [net-next,v2,4/4] net: intel: remove conditional return with no effect
https://git.kernel.org/netdev/net-next/c/1f35011c281a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-30 11:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 15:08 [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 15:08 ` [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return " Sang-Heon Jeon
2026-07-27 9:45 ` Marcin Szycik
2026-07-30 11:10 ` [Intel-wired-lan] [PATCH net-next v2 0/4] net: remove conditional returns " patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox