Skip to contentSkip to conversation

igc: Refactor the igc_power_up_link()

PATCH New Sasha Neftin 3 participants 3 messages Jun 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: Refactor the igc_power_up_link()

PHY of the i225 device support only copper mode.
There is no point to check media type in the
igc_power_up_link() method.

---
 drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
index af5e1686f7f2..83c94fa58c40 100644
@@ -115,8 +115,7 @@ static void igc_power_up_link(struct igc_adapter *adapter)
 {
 	igc_reset_phy(&adapter->hw);
 
-	if (adapter->hw.phy.media_type == igc_media_type_copper)
-		igc_power_up_phy_copper(&adapter->hw);
+	igc_power_up_phy_copper(&adapter->hw);
 
 	igc_setup_link(&adapter->hw);
 }
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 igc: Refactor the igc_power_up_link()

Dear Sasha,

Thank you for the patch.

Am 10.06.20 um 08:12 schrieb Sasha Neftin:

Quoted 3 lines

PHY of the i225 device support only copper mode.
There is no point to check media type in the
igc_power_up_link() method.

One nit regarding the commit message summary. *Refactor* very generic. Could you use something like:

Quoted 12 lines

igc: Remove unneeded check for copper media type

---
  drivers/net/ethernet/intel/igc/igc_main.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +0 -0
index af5e1686f7f2..83c94fa58c40 100644

drivers/net/ethernet/intel/igc/igc_main.c static void igc_power_up_link(struct igc_adapter *adapter) · line 121

Quoted 9 lines
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
@@ -115,8 +115,7 @@ static void igc_power_up_link(struct igc_adapter *adapter)
  {
  	igc_reset_phy(&adapter->hw);
 
-	if (adapter->hw.phy.media_type == igc_media_type_copper)
-		igc_power_up_phy_copper(&adapter->hw);
+	igc_power_up_phy_copper(&adapter->hw);
 
  	igc_setup_link(&adapter->hw);
  }

Kind regards,

Paul

#2 lore raw

PATCH 1/1 igc: Refactor the igc_power_up_link()

Quoted 5 lines · Paul Menzel

Dear Sasha,

Thank you for the patch.

Quoted 9 lines

Am 10.06.20 um 08:12 schrieb Sasha Neftin:

Quoted 3 lines

PHY of the i225 device support only copper mode.
There is no point to check media type in the
igc_power_up_link() method.

One nit regarding the commit message summary. *Refactor* very generic. Could you use something like:

Quoted 1 line

igc: Remove unneeded check for copper media type

Paul, thanks for reviewing this patch. I will send v2.

Quoted 27 lines
Quoted 12 lines

---
? drivers/net/ethernet/intel/igc/igc_main.c | 3 +-- ? 1 file changed, 1 insertion(+), 2 deletions(-)

drivers/net/ethernet/intel/igc/igc_main.c +0 -0
index af5e1686f7f2..83c94fa58c40 100644

drivers/net/ethernet/intel/igc/igc_main.c static void igc_power_up_link(struct igc_adapter · line 120

Quoted 8 lines
drivers/net/ethernet/intel/igc/igc_main.c +1 -2
@@ -115,8 +115,7 @@ static void igc_power_up_link(struct igc_adapter 
 *adapter)
 ? {
 ????? igc_reset_phy(&adapter->hw);
-??? if (adapter->hw.phy.media_type == igc_media_type_copper)
-??????? igc_power_up_phy_copper(&adapter->hw);
+??? igc_power_up_phy_copper(&adapter->hw);
 ????? igc_setup_link(&adapter->hw);
 ? }

Kind regards,

Paul