* [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum
@ 2022-04-13 5:33 Sasha Neftin
2022-04-13 18:13 ` Tony Nguyen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Sasha Neftin @ 2022-04-13 5:33 UTC (permalink / raw)
To: intel-wired-lan
Complete to commit 8e153faf5827 ("igc: Remove unused phy type")
i225 parts have only one phy. There is no point to use phy_type enum.
Clean up the code accordingly, and get rid of the unused enum lines.
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
---
drivers/net/ethernet/intel/igc/igc_base.c | 2 --
drivers/net/ethernet/intel/igc/igc_hw.h | 7 -------
drivers/net/ethernet/intel/igc/igc_phy.c | 10 +++-------
3 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_base.c b/drivers/net/ethernet/intel/igc/igc_base.c
index f068b66b8025..a15927e77272 100644
--- a/drivers/net/ethernet/intel/igc/igc_base.c
+++ b/drivers/net/ethernet/intel/igc/igc_base.c
@@ -182,8 +182,6 @@ static s32 igc_init_phy_params_base(struct igc_hw *hw)
igc_check_for_copper_link(hw);
- phy->type = igc_phy_i225;
-
out:
return ret_val;
}
diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h
index b1e72ec5f131..360644f33d5f 100644
--- a/drivers/net/ethernet/intel/igc/igc_hw.h
+++ b/drivers/net/ethernet/intel/igc/igc_hw.h
@@ -53,11 +53,6 @@ enum igc_mac_type {
igc_num_macs /* List is 1-based, so subtract 1 for true count. */
};
-enum igc_phy_type {
- igc_phy_unknown = 0,
- igc_phy_i225,
-};
-
enum igc_media_type {
igc_media_type_unknown = 0,
igc_media_type_copper = 1,
@@ -138,8 +133,6 @@ struct igc_nvm_info {
struct igc_phy_info {
struct igc_phy_operations ops;
- enum igc_phy_type type;
-
u32 addr;
u32 id;
u32 reset_delay_us; /* in usec */
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 6961f65d36b9..4f06e6bb68b1 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -150,13 +150,9 @@ s32 igc_check_downshift(struct igc_hw *hw)
struct igc_phy_info *phy = &hw->phy;
s32 ret_val;
- switch (phy->type) {
- case igc_phy_i225:
- default:
- /* speed downshift not supported */
- phy->speed_downgraded = false;
- ret_val = 0;
- }
+ /* speed downshift not supported */
+ phy->speed_downgraded = false;
+ ret_val = 0;
return ret_val;
}
--
2.30.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum
2022-04-13 5:33 [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum Sasha Neftin
@ 2022-04-13 18:13 ` Tony Nguyen
2022-04-14 6:15 ` Neftin, Sasha
2022-05-01 8:25 ` naamax.meir
2022-05-04 8:26 ` naamax.meir
2 siblings, 1 reply; 5+ messages in thread
From: Tony Nguyen @ 2022-04-13 18:13 UTC (permalink / raw)
To: intel-wired-lan
On 4/12/2022 10:33 PM, Sasha Neftin wrote:
<snip>
> diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
> index 6961f65d36b9..4f06e6bb68b1 100644
> --- a/drivers/net/ethernet/intel/igc/igc_phy.c
> +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
> @@ -150,13 +150,9 @@ s32 igc_check_downshift(struct igc_hw *hw)
> struct igc_phy_info *phy = &hw->phy;
> s32 ret_val;
>
> - switch (phy->type) {
> - case igc_phy_i225:
> - default:
> - /* speed downshift not supported */
> - phy->speed_downgraded = false;
> - ret_val = 0;
> - }
> + /* speed downshift not supported */
> + phy->speed_downgraded = false;
> + ret_val = 0;
>
> return ret_val;
ret_val isn't needed since it's always returning 0 and could possibly be
made a void function.
Thanks,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum
2022-04-13 18:13 ` Tony Nguyen
@ 2022-04-14 6:15 ` Neftin, Sasha
0 siblings, 0 replies; 5+ messages in thread
From: Neftin, Sasha @ 2022-04-14 6:15 UTC (permalink / raw)
To: intel-wired-lan
On 4/13/2022 21:13, Tony Nguyen wrote:
>
> On 4/12/2022 10:33 PM, Sasha Neftin wrote:
>
> <snip>
>> diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c
>> b/drivers/net/ethernet/intel/igc/igc_phy.c
>> index 6961f65d36b9..4f06e6bb68b1 100644
>> --- a/drivers/net/ethernet/intel/igc/igc_phy.c
>> +++ b/drivers/net/ethernet/intel/igc/igc_phy.c
>> @@ -150,13 +150,9 @@ s32 igc_check_downshift(struct igc_hw *hw)
>> ????? struct igc_phy_info *phy = &hw->phy;
>> ????? s32 ret_val;
>> -??? switch (phy->type) {
>> -??? case igc_phy_i225:
>> -??? default:
>> -??????? /* speed downshift not supported */
>> -??????? phy->speed_downgraded = false;
>> -??????? ret_val = 0;
>> -??? }
>> +??? /* speed downshift not supported */
>> +??? phy->speed_downgraded = false;
>> +??? ret_val = 0;
>> ????? return ret_val;
>
> ret_val isn't needed since it's always returning 0 and could possibly be
> made a void function.
Thank you, Tony, right. I believe it is a minor logical change - it
should be a different patch. I remember we have a few similar cases in
igc. I plan (TODO) to fix them.
>
> Thanks,
>
> Tony
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum
2022-04-13 5:33 [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum Sasha Neftin
2022-04-13 18:13 ` Tony Nguyen
@ 2022-05-01 8:25 ` naamax.meir
2022-05-04 8:26 ` naamax.meir
2 siblings, 0 replies; 5+ messages in thread
From: naamax.meir @ 2022-05-01 8:25 UTC (permalink / raw)
To: intel-wired-lan
On 4/13/2022 08:33, Sasha Neftin wrote:
> Complete to commit 8e153faf5827 ("igc: Remove unused phy type")
> i225 parts have only one phy. There is no point to use phy_type enum.
> Clean up the code accordingly, and get rid of the unused enum lines.
>
> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_base.c | 2 --
> drivers/net/ethernet/intel/igc/igc_hw.h | 7 -------
> drivers/net/ethernet/intel/igc/igc_phy.c | 10 +++-------
> 3 files changed, 3 insertions(+), 16 deletions(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum
2022-04-13 5:33 [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum Sasha Neftin
2022-04-13 18:13 ` Tony Nguyen
2022-05-01 8:25 ` naamax.meir
@ 2022-05-04 8:26 ` naamax.meir
2 siblings, 0 replies; 5+ messages in thread
From: naamax.meir @ 2022-05-04 8:26 UTC (permalink / raw)
To: intel-wired-lan
On 4/13/2022 08:33, Sasha Neftin wrote:
> Complete to commit 8e153faf5827 ("igc: Remove unused phy type")
> i225 parts have only one phy. There is no point to use phy_type enum.
> Clean up the code accordingly, and get rid of the unused enum lines.
>
> Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
> ---
> drivers/net/ethernet/intel/igc/igc_base.c | 2 --
> drivers/net/ethernet/intel/igc/igc_hw.h | 7 -------
> drivers/net/ethernet/intel/igc/igc_phy.c | 10 +++-------
> 3 files changed, 3 insertions(+), 16 deletions(-)
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-04 8:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-13 5:33 [Intel-wired-lan] [PATCH v1 1/1] igc: Remove unused phy_type enum Sasha Neftin
2022-04-13 18:13 ` Tony Nguyen
2022-04-14 6:15 ` Neftin, Sasha
2022-05-01 8:25 ` naamax.meir
2022-05-04 8:26 ` naamax.meir
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox