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

Merge branch 'net-constify-device_type'

Ricardo B. Marliere says:

====================
net: constify struct device_type usage

This is a simple and straight forward cleanup series that makes all device
types in the net subsystem constants. This has been possible since 2011 [1]
but not all occurrences were cleaned. I have been sweeping the tree to fix
them all.

I was not sure if I should send these squashed, but there are quite a few
changes so I decided to send them separately. Please let me know if that is
not desirable.

[1] https://lore.kernel.org/all/1305850262-9575-5-git-send-email-gregkh@suse.de/

====================

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>

+13 -13
+1 -1
drivers/net/geneve.c
··· 1142 1142 }; 1143 1143 1144 1144 /* Info for udev, that this is a virtual tunnel endpoint */ 1145 - static struct device_type geneve_type = { 1145 + static const struct device_type geneve_type = { 1146 1146 .name = "geneve", 1147 1147 }; 1148 1148
+1 -1
drivers/net/netdevsim/bus.c
··· 129 129 complete(&nsim_bus_devs_released); 130 130 } 131 131 132 - static struct device_type nsim_bus_dev_type = { 132 + static const struct device_type nsim_bus_dev_type = { 133 133 .groups = nsim_bus_dev_attr_groups, 134 134 .release = nsim_bus_dev_release, 135 135 };
+1 -1
drivers/net/ppp/ppp_generic.c
··· 1607 1607 .ndo_fill_forward_path = ppp_fill_forward_path, 1608 1608 }; 1609 1609 1610 - static struct device_type ppp_type = { 1610 + static const struct device_type ppp_type = { 1611 1611 .name = "ppp", 1612 1612 }; 1613 1613
+1 -1
drivers/net/usb/hso.c
··· 2465 2465 } 2466 2466 } 2467 2467 2468 - static struct device_type hso_type = { 2468 + static const struct device_type hso_type = { 2469 2469 .name = "wwan", 2470 2470 }; 2471 2471
+2 -2
drivers/net/usb/usbnet.c
··· 1654 1654 1655 1655 // precondition: never called in_interrupt 1656 1656 1657 - static struct device_type wlan_type = { 1657 + static const struct device_type wlan_type = { 1658 1658 .name = "wlan", 1659 1659 }; 1660 1660 1661 - static struct device_type wwan_type = { 1661 + static const struct device_type wwan_type = { 1662 1662 .name = "wwan", 1663 1663 }; 1664 1664
+1 -1
drivers/net/vxlan/vxlan_core.c
··· 3254 3254 }; 3255 3255 3256 3256 /* Info for udev, that this is a virtual tunnel endpoint */ 3257 - static struct device_type vxlan_type = { 3257 + static const struct device_type vxlan_type = { 3258 3258 .name = "vxlan", 3259 3259 }; 3260 3260
+1 -1
drivers/net/wwan/wwan_core.c
··· 920 920 return 0; 921 921 } 922 922 923 - static struct device_type wwan_type = { .name = "wwan" }; 923 + static const struct device_type wwan_type = { .name = "wwan" }; 924 924 925 925 static struct net_device *wwan_rtnl_alloc(struct nlattr *tb[], 926 926 const char *ifname,
+1 -1
net/8021q/vlan_dev.c
··· 537 537 .parse_protocol = vlan_parse_protocol, 538 538 }; 539 539 540 - static struct device_type vlan_type = { 540 + static const struct device_type vlan_type = { 541 541 .name = "vlan", 542 542 }; 543 543
+1 -1
net/bridge/br_device.c
··· 474 474 .ndo_fill_forward_path = br_fill_forward_path, 475 475 }; 476 476 477 - static struct device_type br_type = { 477 + static const struct device_type br_type = { 478 478 .name = "bridge", 479 479 }; 480 480
+1 -1
net/dsa/user.c
··· 2429 2429 .ndo_fill_forward_path = dsa_user_fill_forward_path, 2430 2430 }; 2431 2431 2432 - static struct device_type dsa_type = { 2432 + static const struct device_type dsa_type = { 2433 2433 .name = "dsa", 2434 2434 }; 2435 2435
+1 -1
net/hsr/hsr_device.c
··· 467 467 .ndo_set_rx_mode = hsr_set_rx_mode, 468 468 }; 469 469 470 - static struct device_type hsr_type = { 470 + static const struct device_type hsr_type = { 471 471 .name = "hsr", 472 472 }; 473 473
+1 -1
net/l2tp/l2tp_eth.c
··· 100 100 .ndo_set_mac_address = eth_mac_addr, 101 101 }; 102 102 103 - static struct device_type l2tpeth_type = { 103 + static const struct device_type l2tpeth_type = { 104 104 .name = "l2tpeth", 105 105 }; 106 106