Message ID | 20240613051749.3341996-1-sasha.neftin@intel.com |
---|---|
State | Accepted |
Delegated to: | Anthony Nguyen |
Headers | show |
Series | [iwl-next,v2,1/1] igc: Remove the internal 'eee_advert' field | expand |
On 13/06/2024 8:17, Sasha Neftin wrote: > Since the kernel's 'ethtool_keee' structure is in use, the internal > 'eee_advert' field becomes pointless and can be removed. > > This patch comes to clean up this redundant code. > > Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> > --- > v2: Fixed grammar in the commit message > --- > drivers/net/ethernet/intel/igc/igc.h | 1 - > drivers/net/ethernet/intel/igc/igc_ethtool.c | 6 ------ > drivers/net/ethernet/intel/igc/igc_main.c | 3 --- > 3 files changed, 10 deletions(-) > > diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h > index 8b14c029eda1..c38b4d0f00ce 100644 > --- a/drivers/net/ethernet/intel/igc/igc.h > +++ b/drivers/net/ethernet/intel/igc/igc.h > @@ -202,7 +202,6 @@ struct igc_adapter { > struct net_device *netdev; > > struct ethtool_keee eee; > - u16 eee_advert; > > unsigned long state; > unsigned int flags; > diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c > index a80ac148b402..1e9241103aa9 100644 > --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c > +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c > @@ -1636,10 +1636,6 @@ static int igc_ethtool_get_eee(struct net_device *netdev, > linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, > edata->supported); > > - if (hw->dev_spec._base.eee_enable) > - mii_eee_cap1_mod_linkmode_t(edata->advertised, > - adapter->eee_advert); > - > eeer = rd32(IGC_EEER); > > /* EEE status on negotiated link */ > @@ -1700,8 +1696,6 @@ static int igc_ethtool_set_eee(struct net_device *netdev, > return -EINVAL; > } > > - adapter->eee_advert = linkmode_to_mii_eee_cap1_t(edata->advertised); > - > if (hw->dev_spec._base.eee_enable != edata->eee_enabled) { > hw->dev_spec._base.eee_enable = edata->eee_enabled; > adapter->flags |= IGC_FLAG_EEE; > diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c > index c057d0afaf9a..772f425b1a24 100644 > --- a/drivers/net/ethernet/intel/igc/igc_main.c > +++ b/drivers/net/ethernet/intel/igc/igc_main.c > @@ -4976,9 +4976,6 @@ void igc_up(struct igc_adapter *adapter) > /* start the watchdog. */ > hw->mac.get_link_status = true; > schedule_work(&adapter->watchdog_task); > - > - adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T | > - MDIO_EEE_2_5GT; > } > > /** Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com> (A Contingent worker at Intel)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h index 8b14c029eda1..c38b4d0f00ce 100644 --- a/drivers/net/ethernet/intel/igc/igc.h +++ b/drivers/net/ethernet/intel/igc/igc.h @@ -202,7 +202,6 @@ struct igc_adapter { struct net_device *netdev; struct ethtool_keee eee; - u16 eee_advert; unsigned long state; unsigned int flags; diff --git a/drivers/net/ethernet/intel/igc/igc_ethtool.c b/drivers/net/ethernet/intel/igc/igc_ethtool.c index a80ac148b402..1e9241103aa9 100644 --- a/drivers/net/ethernet/intel/igc/igc_ethtool.c +++ b/drivers/net/ethernet/intel/igc/igc_ethtool.c @@ -1636,10 +1636,6 @@ static int igc_ethtool_get_eee(struct net_device *netdev, linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, edata->supported); - if (hw->dev_spec._base.eee_enable) - mii_eee_cap1_mod_linkmode_t(edata->advertised, - adapter->eee_advert); - eeer = rd32(IGC_EEER); /* EEE status on negotiated link */ @@ -1700,8 +1696,6 @@ static int igc_ethtool_set_eee(struct net_device *netdev, return -EINVAL; } - adapter->eee_advert = linkmode_to_mii_eee_cap1_t(edata->advertised); - if (hw->dev_spec._base.eee_enable != edata->eee_enabled) { hw->dev_spec._base.eee_enable = edata->eee_enabled; adapter->flags |= IGC_FLAG_EEE; diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index c057d0afaf9a..772f425b1a24 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -4976,9 +4976,6 @@ void igc_up(struct igc_adapter *adapter) /* start the watchdog. */ hw->mac.get_link_status = true; schedule_work(&adapter->watchdog_task); - - adapter->eee_advert = MDIO_EEE_100TX | MDIO_EEE_1000T | - MDIO_EEE_2_5GT; } /**
Since the kernel's 'ethtool_keee' structure is in use, the internal 'eee_advert' field becomes pointless and can be removed. This patch comes to clean up this redundant code. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> --- v2: Fixed grammar in the commit message --- drivers/net/ethernet/intel/igc/igc.h | 1 - drivers/net/ethernet/intel/igc/igc_ethtool.c | 6 ------ drivers/net/ethernet/intel/igc/igc_main.c | 3 --- 3 files changed, 10 deletions(-)