Skip to content

Commit 5849b56

Browse files
aloktiwakuba-moo
authored andcommitted
ixgbe: avoid redundant call to ixgbe_non_sfp_link_config()
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>
1 parent 954ba97 commit 5849b56

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7449,7 +7449,7 @@ int ixgbe_open(struct net_device *netdev)
74497449
adapter->hw.link.link_info.link_cfg_err);
74507450

74517451
err = ixgbe_non_sfp_link_config(&adapter->hw);
7452-
if (ixgbe_non_sfp_link_config(&adapter->hw))
7452+
if (err)
74537453
e_dev_err("Link setup failed, err %d.\n", err);
74547454
}
74557455

@@ -12046,7 +12046,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1204612046
* @pdev: PCI device information struct
1204712047
*
1204812048
* ixgbe_remove is called by the PCI subsystem to alert the driver
12049-
* that it should release a PCI device. The could be caused by a
12049+
* that it should release a PCI device. This could be caused by a
1205012050
* Hot-Plug event, or because the driver is going to be removed from
1205112051
* memory.
1205212052
**/

0 commit comments

Comments
 (0)