Skip to contentSkip to conversation

igc: Change type of the 'igc_check_downshift' method

PATCH New Sasha Neftin 3 participants 3 messages Apr 23, 2022 – May 4, 2022

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

PATCH 1/1 igc: Change type of the 'igc_check_downshift' method

The 'igc_check_downshift' method always return 0 value. There is no point return value. Change the return type of this method to void.

---
 drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
 drivers/net/ethernet/intel/igc/igc_phy.h | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/igc/igc_phy.c +1 -5
index 2140ad1e8443..53b77c969c85 100644
@@ -141,18 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
  * igc_check_downshift - Checks whether a downshift in speed occurred
  * @hw: pointer to the HW structure
  *
- * Success returns 0, Failure returns 1
- *
  * A downshift is detected by querying the PHY link health.
  */
-s32 igc_check_downshift(struct igc_hw *hw)
+void igc_check_downshift(struct igc_hw *hw)
 {
 	struct igc_phy_info *phy = &hw->phy;
 
 	/* speed downshift not supported */
 	phy->speed_downgraded = false;
-
-	return 0;
 }
 
 /**
drivers/net/ethernet/intel/igc/igc_phy.h +1 -1
index 1b031372d206..832a7e359f18 100644
@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw);
 s32 igc_get_phy_id(struct igc_hw *hw);
 s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
 		     u32 usec_interval, bool *success);
-s32 igc_check_downshift(struct igc_hw *hw);
+void igc_check_downshift(struct igc_hw *hw);
 s32 igc_setup_copper_link(struct igc_hw *hw);
 void igc_power_up_phy_copper(struct igc_hw *hw);
 void igc_power_down_phy_copper(struct igc_hw *hw);
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 igc: Change type of the 'igc_check_downshift' method

Quoted 8 lines · Sasha Neftin

The 'igc_check_downshift' method always return 0 value. There is no point return value. Change the return type of this method to void.

---
  drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
  drivers/net/ethernet/intel/igc/igc_phy.h | 2 +-
  2 files changed, 2 insertions(+), 6 deletions(-)
#2 lore raw

PATCH 1/1 igc: Change type of the 'igc_check_downshift' method

In reply to Sasha Neftin

Dear Sasha,

Thank you for the patch.

Am 23.04.22 um 18:55 schrieb Sasha Neftin:

Quoted 1 line

The 'igc_check_downshift' method always return 0 value. There is no point

return*s*

Quoted 1 line

return value. Change the return type of this method to void.

Maybe also make the summary more explicit. Maybe:

Change return type of 'igc_check_downshift' to void

Quoted 35 lines
---
  drivers/net/ethernet/intel/igc/igc_phy.c | 6 +-----
  drivers/net/ethernet/intel/igc/igc_phy.h | 2 +-
  2 files changed, 2 insertions(+), 6 deletions(-)
drivers/net/ethernet/intel/igc/igc_phy.c +1 -5
index 2140ad1e8443..53b77c969c85 100644
@@ -141,18 +141,14 @@ void igc_power_down_phy_copper(struct igc_hw *hw)
   * igc_check_downshift - Checks whether a downshift in speed occurred
   * @hw: pointer to the HW structure
   *
- * Success returns 0, Failure returns 1
- *
   * A downshift is detected by querying the PHY link health.
   */
-s32 igc_check_downshift(struct igc_hw *hw)
+void igc_check_downshift(struct igc_hw *hw)
  {
  	struct igc_phy_info *phy = &hw->phy;
 
  	/* speed downshift not supported */
  	phy->speed_downgraded = false;
-
-	return 0;
  }
 
  /**
drivers/net/ethernet/intel/igc/igc_phy.h +0 -0
index 1b031372d206..832a7e359f18 100644

drivers/net/ethernet/intel/igc/igc_phy.h s32 igc_phy_hw_reset(struct igc_hw *hw); · line 17

Quoted 8 lines
drivers/net/ethernet/intel/igc/igc_phy.h +1 -1
@@ -11,7 +11,7 @@ s32 igc_phy_hw_reset(struct igc_hw *hw);
  s32 igc_get_phy_id(struct igc_hw *hw);
  s32 igc_phy_has_link(struct igc_hw *hw, u32 iterations,
  		     u32 usec_interval, bool *success);
-s32 igc_check_downshift(struct igc_hw *hw);
+void igc_check_downshift(struct igc_hw *hw);
  s32 igc_setup_copper_link(struct igc_hw *hw);
  void igc_power_up_phy_copper(struct igc_hw *hw);
  void igc_power_down_phy_copper(struct igc_hw *hw);

The rest looks good.

Kind regards,

Paul