]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: phy: annotate linkmode initializers as not used after init phase
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 27 Sep 2025 19:57:07 +0000 (21:57 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 30 Sep 2025 11:17:31 +0000 (13:17 +0200)
Code and data used from phy_init() only, can be annotated accordingly.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/5fb9c41b-bf44-4915-a3c3-f20952fce6de@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/phy/phy-caps.h
drivers/net/phy/phy_caps.c
drivers/net/phy/phy_device.c

index 157759966650ee1f0952aab3770a7e354a378263..b7f0c6a3037a9b1256c9481ae5d8566520526230 100644 (file)
@@ -41,7 +41,7 @@ struct link_capabilities {
        __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmodes);
 };
 
-int phy_caps_init(void);
+int __init phy_caps_init(void);
 
 size_t phy_caps_speeds(unsigned int *speeds, size_t size,
                       unsigned long *linkmodes);
index 2cc9ee97e867da8a1b98784f5d7434a9b65a1783..23c808b59b6fd3901e8654386f8f7a8bd7ff0b2e 100644 (file)
@@ -70,7 +70,7 @@ static int speed_duplex_to_capa(int speed, unsigned int duplex)
  *         unexpected linkmode setting that requires LINK_CAPS update.
  *
  */
-int phy_caps_init(void)
+int __init phy_caps_init(void)
 {
        const struct link_mode_info *linkmode;
        int i, capa;
index 1c02640412f72c636453ed819a913f358af47cf7..7a67c900e79a5182295e45d5a2fc830ed884555d 100644 (file)
@@ -91,7 +91,7 @@ const int phy_basic_ports_array[3] = {
 };
 EXPORT_SYMBOL_GPL(phy_basic_ports_array);
 
-static const int phy_all_ports_features_array[7] = {
+static const int phy_all_ports_features_array[7] __initconst = {
        ETHTOOL_LINK_MODE_Autoneg_BIT,
        ETHTOOL_LINK_MODE_TP_BIT,
        ETHTOOL_LINK_MODE_MII_BIT,
@@ -101,30 +101,30 @@ static const int phy_all_ports_features_array[7] = {
        ETHTOOL_LINK_MODE_Backplane_BIT,
 };
 
-static const int phy_10_100_features_array[4] = {
+static const int phy_10_100_features_array[4] __initconst = {
        ETHTOOL_LINK_MODE_10baseT_Half_BIT,
        ETHTOOL_LINK_MODE_10baseT_Full_BIT,
        ETHTOOL_LINK_MODE_100baseT_Half_BIT,
        ETHTOOL_LINK_MODE_100baseT_Full_BIT,
 };
 
-static const int phy_basic_t1_features_array[3] = {
+static const int phy_basic_t1_features_array[3] __initconst = {
        ETHTOOL_LINK_MODE_TP_BIT,
        ETHTOOL_LINK_MODE_10baseT1L_Full_BIT,
        ETHTOOL_LINK_MODE_100baseT1_Full_BIT,
 };
 
-static const int phy_basic_t1s_p2mp_features_array[2] = {
+static const int phy_basic_t1s_p2mp_features_array[2] __initconst = {
        ETHTOOL_LINK_MODE_TP_BIT,
        ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT,
 };
 
-static const int phy_gbit_features_array[2] = {
+static const int phy_gbit_features_array[2] __initconst = {
        ETHTOOL_LINK_MODE_1000baseT_Half_BIT,
        ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
 };
 
-static const int phy_eee_cap1_features_array[] = {
+static const int phy_eee_cap1_features_array[] __initconst = {
        ETHTOOL_LINK_MODE_100baseT_Full_BIT,
        ETHTOOL_LINK_MODE_1000baseT_Full_BIT,
        ETHTOOL_LINK_MODE_10000baseT_Full_BIT,
@@ -136,7 +136,7 @@ static const int phy_eee_cap1_features_array[] = {
 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap1_features) __ro_after_init;
 EXPORT_SYMBOL_GPL(phy_eee_cap1_features);
 
-static const int phy_eee_cap2_features_array[] = {
+static const int phy_eee_cap2_features_array[] __initconst = {
        ETHTOOL_LINK_MODE_2500baseT_Full_BIT,
        ETHTOOL_LINK_MODE_5000baseT_Full_BIT,
 };
@@ -144,7 +144,7 @@ static const int phy_eee_cap2_features_array[] = {
 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init;
 EXPORT_SYMBOL_GPL(phy_eee_cap2_features);
 
-static void features_init(void)
+static void __init features_init(void)
 {
        /* 10/100 half/full*/
        linkmode_set_bit_array(phy_basic_ports_array,