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

dsa: Cleanup unneeded table and make tag structures static

Now that tag drivers dynamically register, we don't need the static
table. Remove it. This also means the tag driver structures can be
made static.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andrew Lunn and committed by
David S. Miller
f81a43e8 36756175

+11 -77
-1
include/net/dsa.h
··· 56 56 DSA_TAG_PROTO_MTK = DSA_TAG_PROTO_MTK_VALUE, 57 57 DSA_TAG_PROTO_QCA = DSA_TAG_PROTO_QCA_VALUE, 58 58 DSA_TAG_PROTO_TRAILER = DSA_TAG_PROTO_TRAILER_VALUE, 59 - DSA_TAG_LAST, /* MUST BE LAST */ 60 59 }; 61 60 62 61 struct packet_type;
-35
net/dsa/dsa.c
··· 46 46 47 47 DSA_TAG_DRIVER(none_ops); 48 48 49 - const struct dsa_device_ops *dsa_device_ops[DSA_TAG_LAST] = { 50 - #ifdef CONFIG_NET_DSA_TAG_BRCM 51 - [DSA_TAG_PROTO_BRCM] = &brcm_netdev_ops, 52 - #endif 53 - #ifdef CONFIG_NET_DSA_TAG_BRCM_PREPEND 54 - [DSA_TAG_PROTO_BRCM_PREPEND] = &brcm_prepend_netdev_ops, 55 - #endif 56 - #ifdef CONFIG_NET_DSA_TAG_DSA 57 - [DSA_TAG_PROTO_DSA] = &dsa_netdev_ops, 58 - #endif 59 - #ifdef CONFIG_NET_DSA_TAG_EDSA 60 - [DSA_TAG_PROTO_EDSA] = &edsa_netdev_ops, 61 - #endif 62 - #ifdef CONFIG_NET_DSA_TAG_GSWIP 63 - [DSA_TAG_PROTO_GSWIP] = &gswip_netdev_ops, 64 - #endif 65 - #ifdef CONFIG_NET_DSA_TAG_KSZ9477 66 - [DSA_TAG_PROTO_KSZ9477] = &ksz9477_netdev_ops, 67 - [DSA_TAG_PROTO_KSZ9893] = &ksz9893_netdev_ops, 68 - #endif 69 - #ifdef CONFIG_NET_DSA_TAG_LAN9303 70 - [DSA_TAG_PROTO_LAN9303] = &lan9303_netdev_ops, 71 - #endif 72 - #ifdef CONFIG_NET_DSA_TAG_MTK 73 - [DSA_TAG_PROTO_MTK] = &mtk_netdev_ops, 74 - #endif 75 - #ifdef CONFIG_NET_DSA_TAG_QCA 76 - [DSA_TAG_PROTO_QCA] = &qca_netdev_ops, 77 - #endif 78 - #ifdef CONFIG_NET_DSA_TAG_TRAILER 79 - [DSA_TAG_PROTO_TRAILER] = &trailer_netdev_ops, 80 - #endif 81 - [DSA_TAG_PROTO_NONE] = &none_ops, 82 - }; 83 - 84 49 static void dsa_tag_driver_register(struct dsa_tag_driver *dsa_tag_driver, 85 50 struct module *owner) 86 51 {
-30
net/dsa/dsa_priv.h
··· 202 202 /* switch.c */ 203 203 int dsa_switch_register_notifier(struct dsa_switch *ds); 204 204 void dsa_switch_unregister_notifier(struct dsa_switch *ds); 205 - 206 - /* tag_brcm.c */ 207 - extern const struct dsa_device_ops brcm_netdev_ops; 208 - extern const struct dsa_device_ops brcm_prepend_netdev_ops; 209 - 210 - /* tag_dsa.c */ 211 - extern const struct dsa_device_ops dsa_netdev_ops; 212 - 213 - /* tag_edsa.c */ 214 - extern const struct dsa_device_ops edsa_netdev_ops; 215 - 216 - /* tag_gswip.c */ 217 - extern const struct dsa_device_ops gswip_netdev_ops; 218 - 219 - /* tag_ksz.c */ 220 - extern const struct dsa_device_ops ksz9477_netdev_ops; 221 - extern const struct dsa_device_ops ksz9893_netdev_ops; 222 - 223 - /* tag_lan9303.c */ 224 - extern const struct dsa_device_ops lan9303_netdev_ops; 225 - 226 - /* tag_mtk.c */ 227 - extern const struct dsa_device_ops mtk_netdev_ops; 228 - 229 - /* tag_qca.c */ 230 - extern const struct dsa_device_ops qca_netdev_ops; 231 - 232 - /* tag_trailer.c */ 233 - extern const struct dsa_device_ops trailer_netdev_ops; 234 - 235 205 #endif
+2 -2
net/dsa/tag_brcm.c
··· 167 167 return nskb; 168 168 } 169 169 170 - const struct dsa_device_ops brcm_netdev_ops = { 170 + static const struct dsa_device_ops brcm_netdev_ops = { 171 171 .name = "brcm", 172 172 .proto = DSA_TAG_PROTO_BRCM, 173 173 .xmit = brcm_tag_xmit, ··· 195 195 return brcm_tag_rcv_ll(skb, dev, pt, ETH_HLEN); 196 196 } 197 197 198 - const struct dsa_device_ops brcm_prepend_netdev_ops = { 198 + static const struct dsa_device_ops brcm_prepend_netdev_ops = { 199 199 .name = "brcm-prepend", 200 200 .proto = DSA_TAG_PROTO_BRCM_PREPEND, 201 201 .xmit = brcm_tag_xmit_prepend,
+1 -1
net/dsa/tag_dsa.c
··· 150 150 return 0; 151 151 } 152 152 153 - const struct dsa_device_ops dsa_netdev_ops = { 153 + static const struct dsa_device_ops dsa_netdev_ops = { 154 154 .name = "dsa", 155 155 .proto = DSA_TAG_PROTO_DSA, 156 156 .xmit = dsa_xmit,
+1 -1
net/dsa/tag_edsa.c
··· 169 169 return 0; 170 170 } 171 171 172 - const struct dsa_device_ops edsa_netdev_ops = { 172 + static const struct dsa_device_ops edsa_netdev_ops = { 173 173 .name = "edsa", 174 174 .proto = DSA_TAG_PROTO_EDSA, 175 175 .xmit = edsa_xmit,
+1 -1
net/dsa/tag_gswip.c
··· 103 103 return skb; 104 104 } 105 105 106 - const struct dsa_device_ops gswip_netdev_ops = { 106 + static const struct dsa_device_ops gswip_netdev_ops = { 107 107 .name = "gwsip", 108 108 .proto = DSA_TAG_PROTO_GSWIP, 109 109 .xmit = gswip_tag_xmit,
+2 -2
net/dsa/tag_ksz.c
··· 133 133 return ksz_common_rcv(skb, dev, port, len); 134 134 } 135 135 136 - const struct dsa_device_ops ksz9477_netdev_ops = { 136 + static const struct dsa_device_ops ksz9477_netdev_ops = { 137 137 .name = "ksz9477", 138 138 .proto = DSA_TAG_PROTO_KSZ9477, 139 139 .xmit = ksz9477_xmit, ··· 171 171 return nskb; 172 172 } 173 173 174 - const struct dsa_device_ops ksz9893_netdev_ops = { 174 + static const struct dsa_device_ops ksz9893_netdev_ops = { 175 175 .name = "ksz9893", 176 176 .proto = DSA_TAG_PROTO_KSZ9893, 177 177 .xmit = ksz9893_xmit,
+1 -1
net/dsa/tag_lan9303.c
··· 128 128 return skb; 129 129 } 130 130 131 - const struct dsa_device_ops lan9303_netdev_ops = { 131 + static const struct dsa_device_ops lan9303_netdev_ops = { 132 132 .name = "lan9303", 133 133 .proto = DSA_TAG_PROTO_LAN9303, 134 134 .xmit = lan9303_xmit,
+1 -1
net/dsa/tag_mtk.c
··· 98 98 return 0; 99 99 } 100 100 101 - const struct dsa_device_ops mtk_netdev_ops = { 101 + static const struct dsa_device_ops mtk_netdev_ops = { 102 102 .name = "mtk", 103 103 .proto = DSA_TAG_PROTO_MTK, 104 104 .xmit = mtk_tag_xmit,
+1 -1
net/dsa/tag_qca.c
··· 99 99 return 0; 100 100 } 101 101 102 - const struct dsa_device_ops qca_netdev_ops = { 102 + static const struct dsa_device_ops qca_netdev_ops = { 103 103 .name = "qca", 104 104 .proto = DSA_TAG_PROTO_QCA, 105 105 .xmit = qca_tag_xmit,
+1 -1
net/dsa/tag_trailer.c
··· 77 77 return skb; 78 78 } 79 79 80 - const struct dsa_device_ops trailer_netdev_ops = { 80 + static const struct dsa_device_ops trailer_netdev_ops = { 81 81 .name = "trailer", 82 82 .proto = DSA_TAG_PROTO_TRAILER, 83 83 .xmit = trailer_xmit,