]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ixgbe: avoid redundant call to ixgbe_non_sfp_link_config()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 25 Nov 2025 22:36:26 +0000 (14:36 -0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Nov 2025 02:34:21 +0000 (18:34 -0800)
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>
Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20251125223632.1857532-8-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 3190ce7e44c742d95af568dae6e1e35267b49794..4af3b3e71ff1c3db8dfb7c023cf9cff257060b78 100644 (file)
@@ -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);
        }
 
@@ -12046,7 +12046,7 @@ err_dma:
  * @pdev: PCI device information struct
  *
  * ixgbe_remove is called by the PCI subsystem to alert the driver
- * that it should release a PCI device.  The could be caused by a
+ * that it should release a PCI device.  This could be caused by a
  * Hot-Plug event, or because the driver is going to be removed from
  * memory.
  **/