From: Marcin Szycik <marcin.szycik@linux.intel.com>
To: Sang-Heon Jeon <ekffu200098@gmail.com>,
kuba@kernel.org, Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>
Cc: intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH net-next v2 4/4] net: intel: remove conditional return with no effect
Date: Mon, 27 Jul 2026 11:45:57 +0200 [thread overview]
Message-ID: <cb66f729-2869-4116-bac0-15bb6557a7dd@linux.intel.com> (raw)
In-Reply-To: <20260725150852.859188-5-ekffu200098@gmail.com>
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);
> }
>
> /**
prev parent reply other threads:[~2026-07-27 9:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 15:08 [PATCH net-next v2 0/4] net: remove conditional returns with no effect Sang-Heon Jeon
2026-07-25 15:08 ` [PATCH net-next v2 1/4] dpll: zl3073x: remove conditional return " Sang-Heon Jeon
2026-07-27 9:57 ` Ivan Vecera
2026-07-25 15:08 ` [PATCH net-next v2 2/4] net: ethernet: " Sang-Heon Jeon
2026-07-27 11:27 ` Ioana Ciornei
2026-07-25 15:08 ` [PATCH net-next v2 3/4] net: " Sang-Heon Jeon
2026-07-25 15:08 ` [PATCH net-next v2 4/4] net: intel: " Sang-Heon Jeon
2026-07-27 9:45 ` Marcin Szycik [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb66f729-2869-4116-bac0-15bb6557a7dd@linux.intel.com \
--to=marcin.szycik@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ekffu200098@gmail.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox