Message ID | 01886672-4880-4ca8-b7b0-94d40f6e0ec5@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d3a0e217f850a768851974a6efbd70f5673bb584 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: phy: clean up phy.h | expand |
On 2/13/2025 10:49 PM, Heiner Kallweit wrote: > Stop exporting feature arrays which aren't used outside phylib. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > drivers/net/phy/phy_device.c | 22 ++++++---------------- > include/linux/phy.h | 5 ----- > 2 files changed, 6 insertions(+), 21 deletions(-) > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 14c312ad2..1c10c774b 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -91,37 +91,28 @@ static const int phy_all_ports_features_array[7] = { > ETHTOOL_LINK_MODE_Backplane_BIT, > }; > > -const int phy_10_100_features_array[4] = { > +static const int phy_10_100_features_array[4] = { > ETHTOOL_LINK_MODE_10baseT_Half_BIT, > ETHTOOL_LINK_MODE_10baseT_Full_BIT, > ETHTOOL_LINK_MODE_100baseT_Half_BIT, > ETHTOOL_LINK_MODE_100baseT_Full_BIT, > }; > -EXPORT_SYMBOL_GPL(phy_10_100_features_array); > > -const int phy_basic_t1_features_array[3] = { > +static const int phy_basic_t1_features_array[3] = { > ETHTOOL_LINK_MODE_TP_BIT, > ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, > ETHTOOL_LINK_MODE_100baseT1_Full_BIT, > }; > -EXPORT_SYMBOL_GPL(phy_basic_t1_features_array); > > -const int phy_basic_t1s_p2mp_features_array[2] = { > +static const int phy_basic_t1s_p2mp_features_array[2] = { > ETHTOOL_LINK_MODE_TP_BIT, > ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT, > }; > -EXPORT_SYMBOL_GPL(phy_basic_t1s_p2mp_features_array); > > -const int phy_gbit_features_array[2] = { > +static const int phy_gbit_features_array[2] = { > ETHTOOL_LINK_MODE_1000baseT_Half_BIT, > ETHTOOL_LINK_MODE_1000baseT_Full_BIT, > }; > -EXPORT_SYMBOL_GPL(phy_gbit_features_array); > - > -const int phy_10gbit_features_array[1] = { > - ETHTOOL_LINK_MODE_10000baseT_Full_BIT, > -}; > -EXPORT_SYMBOL_GPL(phy_10gbit_features_array); > > static const int phy_eee_cap1_features_array[] = { > ETHTOOL_LINK_MODE_100baseT_Full_BIT, > @@ -196,9 +187,8 @@ static void features_init(void) > linkmode_set_bit_array(phy_gbit_features_array, > ARRAY_SIZE(phy_gbit_features_array), > phy_10gbit_features); > - linkmode_set_bit_array(phy_10gbit_features_array, > - ARRAY_SIZE(phy_10gbit_features_array), > - phy_10gbit_features); > + linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, > + phy_10gbit_features); > > linkmode_set_bit_array(phy_eee_cap1_features_array, > ARRAY_SIZE(phy_eee_cap1_features_array), > diff --git a/include/linux/phy.h b/include/linux/phy.h > index 96e427c2c..33e2c2c93 100644 > --- a/include/linux/phy.h > +++ b/include/linux/phy.h > @@ -54,11 +54,6 @@ extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init; > #define PHY_EEE_CAP2_FEATURES ((unsigned long *)&phy_eee_cap2_features) > > extern const int phy_basic_ports_array[3]; > -extern const int phy_10_100_features_array[4]; > -extern const int phy_basic_t1_features_array[3]; > -extern const int phy_basic_t1s_p2mp_features_array[2]; > -extern const int phy_gbit_features_array[2]; > -extern const int phy_10gbit_features_array[1]; > > /* > * Set phydev->irq to PHY_POLL if interrupts are not supported, Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
On Thu, Feb 13, 2025 at 10:49:19PM +0100, Heiner Kallweit wrote: > Stop exporting feature arrays which aren't used outside phylib. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> My grep confirms. Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Thanks!
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 14c312ad2..1c10c774b 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -91,37 +91,28 @@ static const int phy_all_ports_features_array[7] = { ETHTOOL_LINK_MODE_Backplane_BIT, }; -const int phy_10_100_features_array[4] = { +static const int phy_10_100_features_array[4] = { ETHTOOL_LINK_MODE_10baseT_Half_BIT, ETHTOOL_LINK_MODE_10baseT_Full_BIT, ETHTOOL_LINK_MODE_100baseT_Half_BIT, ETHTOOL_LINK_MODE_100baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL(phy_10_100_features_array); -const int phy_basic_t1_features_array[3] = { +static const int phy_basic_t1_features_array[3] = { ETHTOOL_LINK_MODE_TP_BIT, ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, ETHTOOL_LINK_MODE_100baseT1_Full_BIT, }; -EXPORT_SYMBOL_GPL(phy_basic_t1_features_array); -const int phy_basic_t1s_p2mp_features_array[2] = { +static const int phy_basic_t1s_p2mp_features_array[2] = { ETHTOOL_LINK_MODE_TP_BIT, ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT, }; -EXPORT_SYMBOL_GPL(phy_basic_t1s_p2mp_features_array); -const int phy_gbit_features_array[2] = { +static const int phy_gbit_features_array[2] = { ETHTOOL_LINK_MODE_1000baseT_Half_BIT, ETHTOOL_LINK_MODE_1000baseT_Full_BIT, }; -EXPORT_SYMBOL_GPL(phy_gbit_features_array); - -const int phy_10gbit_features_array[1] = { - ETHTOOL_LINK_MODE_10000baseT_Full_BIT, -}; -EXPORT_SYMBOL_GPL(phy_10gbit_features_array); static const int phy_eee_cap1_features_array[] = { ETHTOOL_LINK_MODE_100baseT_Full_BIT, @@ -196,9 +187,8 @@ static void features_init(void) linkmode_set_bit_array(phy_gbit_features_array, ARRAY_SIZE(phy_gbit_features_array), phy_10gbit_features); - linkmode_set_bit_array(phy_10gbit_features_array, - ARRAY_SIZE(phy_10gbit_features_array), - phy_10gbit_features); + linkmode_set_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, + phy_10gbit_features); linkmode_set_bit_array(phy_eee_cap1_features_array, ARRAY_SIZE(phy_eee_cap1_features_array), diff --git a/include/linux/phy.h b/include/linux/phy.h index 96e427c2c..33e2c2c93 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -54,11 +54,6 @@ extern __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init; #define PHY_EEE_CAP2_FEATURES ((unsigned long *)&phy_eee_cap2_features) extern const int phy_basic_ports_array[3]; -extern const int phy_10_100_features_array[4]; -extern const int phy_basic_t1_features_array[3]; -extern const int phy_basic_t1s_p2mp_features_array[2]; -extern const int phy_gbit_features_array[2]; -extern const int phy_10gbit_features_array[1]; /* * Set phydev->irq to PHY_POLL if interrupts are not supported,
Stop exporting feature arrays which aren't used outside phylib. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/phy/phy_device.c | 22 ++++++---------------- include/linux/phy.h | 5 ----- 2 files changed, 6 insertions(+), 21 deletions(-)