Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: annotate linkmode initializers as not used after init phase

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>

authored by

Heiner Kallweit and committed by
Paolo Abeni
49ac3d78 e211c463

+10 -10
+1 -1
drivers/net/phy/phy-caps.h
··· 41 41 __ETHTOOL_DECLARE_LINK_MODE_MASK(linkmodes); 42 42 }; 43 43 44 - int phy_caps_init(void); 44 + int __init phy_caps_init(void); 45 45 46 46 size_t phy_caps_speeds(unsigned int *speeds, size_t size, 47 47 unsigned long *linkmodes);
+1 -1
drivers/net/phy/phy_caps.c
··· 70 70 * unexpected linkmode setting that requires LINK_CAPS update. 71 71 * 72 72 */ 73 - int phy_caps_init(void) 73 + int __init phy_caps_init(void) 74 74 { 75 75 const struct link_mode_info *linkmode; 76 76 int i, capa;
+8 -8
drivers/net/phy/phy_device.c
··· 91 91 }; 92 92 EXPORT_SYMBOL_GPL(phy_basic_ports_array); 93 93 94 - static const int phy_all_ports_features_array[7] = { 94 + static const int phy_all_ports_features_array[7] __initconst = { 95 95 ETHTOOL_LINK_MODE_Autoneg_BIT, 96 96 ETHTOOL_LINK_MODE_TP_BIT, 97 97 ETHTOOL_LINK_MODE_MII_BIT, ··· 101 101 ETHTOOL_LINK_MODE_Backplane_BIT, 102 102 }; 103 103 104 - static const int phy_10_100_features_array[4] = { 104 + static const int phy_10_100_features_array[4] __initconst = { 105 105 ETHTOOL_LINK_MODE_10baseT_Half_BIT, 106 106 ETHTOOL_LINK_MODE_10baseT_Full_BIT, 107 107 ETHTOOL_LINK_MODE_100baseT_Half_BIT, 108 108 ETHTOOL_LINK_MODE_100baseT_Full_BIT, 109 109 }; 110 110 111 - static const int phy_basic_t1_features_array[3] = { 111 + static const int phy_basic_t1_features_array[3] __initconst = { 112 112 ETHTOOL_LINK_MODE_TP_BIT, 113 113 ETHTOOL_LINK_MODE_10baseT1L_Full_BIT, 114 114 ETHTOOL_LINK_MODE_100baseT1_Full_BIT, 115 115 }; 116 116 117 - static const int phy_basic_t1s_p2mp_features_array[2] = { 117 + static const int phy_basic_t1s_p2mp_features_array[2] __initconst = { 118 118 ETHTOOL_LINK_MODE_TP_BIT, 119 119 ETHTOOL_LINK_MODE_10baseT1S_P2MP_Half_BIT, 120 120 }; 121 121 122 - static const int phy_gbit_features_array[2] = { 122 + static const int phy_gbit_features_array[2] __initconst = { 123 123 ETHTOOL_LINK_MODE_1000baseT_Half_BIT, 124 124 ETHTOOL_LINK_MODE_1000baseT_Full_BIT, 125 125 }; 126 126 127 - static const int phy_eee_cap1_features_array[] = { 127 + static const int phy_eee_cap1_features_array[] __initconst = { 128 128 ETHTOOL_LINK_MODE_100baseT_Full_BIT, 129 129 ETHTOOL_LINK_MODE_1000baseT_Full_BIT, 130 130 ETHTOOL_LINK_MODE_10000baseT_Full_BIT, ··· 136 136 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap1_features) __ro_after_init; 137 137 EXPORT_SYMBOL_GPL(phy_eee_cap1_features); 138 138 139 - static const int phy_eee_cap2_features_array[] = { 139 + static const int phy_eee_cap2_features_array[] __initconst = { 140 140 ETHTOOL_LINK_MODE_2500baseT_Full_BIT, 141 141 ETHTOOL_LINK_MODE_5000baseT_Full_BIT, 142 142 }; ··· 144 144 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_eee_cap2_features) __ro_after_init; 145 145 EXPORT_SYMBOL_GPL(phy_eee_cap2_features); 146 146 147 - static void features_init(void) 147 + static void __init features_init(void) 148 148 { 149 149 /* 10/100 half/full*/ 150 150 linkmode_set_bit_array(phy_basic_ports_array,