From: Simon Horman <horms@kernel.org>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: anthony.l.nguyen@intel.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Subject: Re: [Intel-wired-lan] [PATCH net-next] ixgbe: avoid redundant call to ixgbe_non_sfp_link_config()
Date: Thu, 25 Sep 2025 11:23:29 +0100 [thread overview]
Message-ID: <20250925102329.GE836419@horms.kernel.org> (raw)
In-Reply-To: <20250924193403.360122-1-alok.a.tiwari@oracle.com>
On Wed, Sep 24, 2025 at 12:33:54PM -0700, Alok Tiwari wrote:
> ixgbe_non_sfp_link_config() is called twice in ixgbe_open()
> once to assign its return value to err and again in the
> conditional check. This patch uses the stored err value
> instead of calling the function a second time. This avoids
> redundant work and ensures consistent error reporting.
>
> Also fix a small typo in the ixgbe_remove() comment:
> "The could be caused" -> "This could be caused".
>
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 90d4e57b1c93..39ef604af3eb 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7449,7 +7449,7 @@ int ixgbe_open(struct net_device *netdev)
> adapter->hw.link.link_info.link_cfg_err);
>
> err = ixgbe_non_sfp_link_config(&adapter->hw);
> - if (ixgbe_non_sfp_link_config(&adapter->hw))
> + if (err)
> e_dev_err("Link setup failed, err %d.\n", err);
> }
>
I am wondering if there is some intended side-effect of
calling ixgbe_non_sfp_link_config() twice.
...
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Alok Tiwari <alok.a.tiwari@oracle.com>
Cc: anthony.l.nguyen@intel.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Subject: Re: [PATCH net-next] ixgbe: avoid redundant call to ixgbe_non_sfp_link_config()
Date: Thu, 25 Sep 2025 11:23:29 +0100 [thread overview]
Message-ID: <20250925102329.GE836419@horms.kernel.org> (raw)
In-Reply-To: <20250924193403.360122-1-alok.a.tiwari@oracle.com>
On Wed, Sep 24, 2025 at 12:33:54PM -0700, Alok Tiwari wrote:
> ixgbe_non_sfp_link_config() is called twice in ixgbe_open()
> once to assign its return value to err and again in the
> conditional check. This patch uses the stored err value
> instead of calling the function a second time. This avoids
> redundant work and ensures consistent error reporting.
>
> Also fix a small typo in the ixgbe_remove() comment:
> "The could be caused" -> "This could be caused".
>
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> index 90d4e57b1c93..39ef604af3eb 100644
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> @@ -7449,7 +7449,7 @@ int ixgbe_open(struct net_device *netdev)
> adapter->hw.link.link_info.link_cfg_err);
>
> err = ixgbe_non_sfp_link_config(&adapter->hw);
> - if (ixgbe_non_sfp_link_config(&adapter->hw))
> + if (err)
> e_dev_err("Link setup failed, err %d.\n", err);
> }
>
I am wondering if there is some intended side-effect of
calling ixgbe_non_sfp_link_config() twice.
...
next prev parent reply other threads:[~2025-09-25 10:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 19:33 [Intel-wired-lan] [PATCH net-next] ixgbe: avoid redundant call to ixgbe_non_sfp_link_config() Alok Tiwari
2025-09-24 19:33 ` Alok Tiwari
2025-09-25 10:23 ` Simon Horman [this message]
2025-09-25 10:23 ` Simon Horman
2025-09-29 23:04 ` [Intel-wired-lan] " Jacob Keller
2025-09-29 23:04 ` Jacob Keller
2025-09-30 8:33 ` [Intel-wired-lan] " Jagielski, Jedrzej
2025-09-30 8:33 ` Jagielski, Jedrzej
2025-10-02 7:06 ` [Intel-wired-lan] " Paul Menzel
2025-11-07 10:20 ` Rinitha, SX
2025-11-07 10:20 ` Rinitha, SX
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=20250925102329.GE836419@horms.kernel.org \
--to=horms@kernel.org \
--cc=alok.a.tiwari@oracle.com \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.