Commit ec1b4cf74c81bfd0fbe5bf62bafc86c45917e72f

Authored by Stephen Hemminger
Committed by David S. Miller
1 parent f7734fdf61

net: mark net_proto_ops as const

All usages of structure net_proto_ops should be declared const.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 35 changed files with 36 additions and 37 deletions Side-by-side Diff

drivers/isdn/mISDN/socket.c
... ... @@ -808,8 +808,7 @@
808 808 return err;
809 809 }
810 810  
811   -static struct
812   -net_proto_family mISDN_sock_family_ops = {
  811 +static const struct net_proto_family mISDN_sock_family_ops = {
813 812 .owner = THIS_MODULE,
814 813 .family = PF_ISDN,
815 814 .create = mISDN_sock_create,
... ... @@ -125,7 +125,7 @@
125 125 return rc;
126 126 }
127 127  
128   -static struct net_proto_family pppox_proto_family = {
  128 +static const struct net_proto_family pppox_proto_family = {
129 129 .family = PF_PPPOX,
130 130 .create = pppox_create,
131 131 .owner = THIS_MODULE,
include/net/bluetooth/bluetooth.h
... ... @@ -121,7 +121,7 @@
121 121 rwlock_t lock;
122 122 };
123 123  
124   -int bt_sock_register(int proto, struct net_proto_family *ops);
  124 +int bt_sock_register(int proto, const struct net_proto_family *ops);
125 125 int bt_sock_unregister(int proto);
126 126 void bt_sock_link(struct bt_sock_list *l, struct sock *s);
127 127 void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
... ... @@ -1821,7 +1821,7 @@
1821 1821 #endif
1822 1822  
1823 1823  
1824   -static struct net_proto_family atalk_family_ops = {
  1824 +static const struct net_proto_family atalk_family_ops = {
1825 1825 .family = PF_APPLETALK,
1826 1826 .create = atalk_create,
1827 1827 .owner = THIS_MODULE,
... ... @@ -137,7 +137,7 @@
137 137 }
138 138  
139 139  
140   -static struct net_proto_family pvc_family_ops = {
  140 +static const struct net_proto_family pvc_family_ops = {
141 141 .family = PF_ATMPVC,
142 142 .create = pvc_create,
143 143 .owner = THIS_MODULE,
... ... @@ -666,7 +666,7 @@
666 666 }
667 667  
668 668  
669   -static struct net_proto_family svc_family_ops = {
  669 +static const struct net_proto_family svc_family_ops = {
670 670 .family = PF_ATMSVC,
671 671 .create = svc_create,
672 672 .owner = THIS_MODULE,
... ... @@ -1961,7 +1961,7 @@
1961 1961  
1962 1962 #endif
1963 1963  
1964   -static struct net_proto_family ax25_family_ops = {
  1964 +static const struct net_proto_family ax25_family_ops = {
1965 1965 .family = PF_AX25,
1966 1966 .create = ax25_create,
1967 1967 .owner = THIS_MODULE,
net/bluetooth/af_bluetooth.c
... ... @@ -45,7 +45,7 @@
45 45  
46 46 /* Bluetooth sockets */
47 47 #define BT_MAX_PROTO 8
48   -static struct net_proto_family *bt_proto[BT_MAX_PROTO];
  48 +static const struct net_proto_family *bt_proto[BT_MAX_PROTO];
49 49 static DEFINE_RWLOCK(bt_proto_lock);
50 50  
51 51 static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
... ... @@ -86,7 +86,7 @@
86 86 bt_key_strings[proto], &bt_lock_key[proto]);
87 87 }
88 88  
89   -int bt_sock_register(int proto, struct net_proto_family *ops)
  89 +int bt_sock_register(int proto, const struct net_proto_family *ops)
90 90 {
91 91 int err = 0;
92 92  
net/bluetooth/bnep/sock.c
... ... @@ -222,7 +222,7 @@
222 222 return 0;
223 223 }
224 224  
225   -static struct net_proto_family bnep_sock_family_ops = {
  225 +static const struct net_proto_family bnep_sock_family_ops = {
226 226 .family = PF_BLUETOOTH,
227 227 .owner = THIS_MODULE,
228 228 .create = bnep_sock_create
net/bluetooth/cmtp/sock.c
... ... @@ -217,7 +217,7 @@
217 217 return 0;
218 218 }
219 219  
220   -static struct net_proto_family cmtp_sock_family_ops = {
  220 +static const struct net_proto_family cmtp_sock_family_ops = {
221 221 .family = PF_BLUETOOTH,
222 222 .owner = THIS_MODULE,
223 223 .create = cmtp_sock_create
net/bluetooth/hci_sock.c
... ... @@ -687,7 +687,7 @@
687 687 return NOTIFY_DONE;
688 688 }
689 689  
690   -static struct net_proto_family hci_sock_family_ops = {
  690 +static const struct net_proto_family hci_sock_family_ops = {
691 691 .family = PF_BLUETOOTH,
692 692 .owner = THIS_MODULE,
693 693 .create = hci_sock_create,
net/bluetooth/hidp/sock.c
... ... @@ -268,7 +268,7 @@
268 268 return 0;
269 269 }
270 270  
271   -static struct net_proto_family hidp_sock_family_ops = {
  271 +static const struct net_proto_family hidp_sock_family_ops = {
272 272 .family = PF_BLUETOOTH,
273 273 .owner = THIS_MODULE,
274 274 .create = hidp_sock_create
net/bluetooth/l2cap.c
... ... @@ -3916,7 +3916,7 @@
3916 3916 .getsockopt = l2cap_sock_getsockopt
3917 3917 };
3918 3918  
3919   -static struct net_proto_family l2cap_sock_family_ops = {
  3919 +static const struct net_proto_family l2cap_sock_family_ops = {
3920 3920 .family = PF_BLUETOOTH,
3921 3921 .owner = THIS_MODULE,
3922 3922 .create = l2cap_sock_create,
net/bluetooth/rfcomm/sock.c
... ... @@ -1101,7 +1101,7 @@
1101 1101 .mmap = sock_no_mmap
1102 1102 };
1103 1103  
1104   -static struct net_proto_family rfcomm_sock_family_ops = {
  1104 +static const struct net_proto_family rfcomm_sock_family_ops = {
1105 1105 .family = PF_BLUETOOTH,
1106 1106 .owner = THIS_MODULE,
1107 1107 .create = rfcomm_sock_create
... ... @@ -993,7 +993,7 @@
993 993 .getsockopt = sco_sock_getsockopt
994 994 };
995 995  
996   -static struct net_proto_family sco_sock_family_ops = {
  996 +static const struct net_proto_family sco_sock_family_ops = {
997 997 .family = PF_BLUETOOTH,
998 998 .owner = THIS_MODULE,
999 999 .create = sco_sock_create,
... ... @@ -842,7 +842,7 @@
842 842 .func = can_rcv,
843 843 };
844 844  
845   -static struct net_proto_family can_family_ops __read_mostly = {
  845 +static const struct net_proto_family can_family_ops = {
846 846 .family = PF_CAN,
847 847 .create = can_create,
848 848 .owner = THIS_MODULE,
net/decnet/af_decnet.c
... ... @@ -2325,7 +2325,7 @@
2325 2325 };
2326 2326 #endif
2327 2327  
2328   -static struct net_proto_family dn_family_ops = {
  2328 +static const struct net_proto_family dn_family_ops = {
2329 2329 .family = AF_DECnet,
2330 2330 .create = dn_create,
2331 2331 .owner = THIS_MODULE,
net/econet/af_econet.c
... ... @@ -742,7 +742,7 @@
742 742 return 0;
743 743 }
744 744  
745   -static struct net_proto_family econet_family_ops = {
  745 +static const struct net_proto_family econet_family_ops = {
746 746 .family = PF_ECONET,
747 747 .create = econet_create,
748 748 .owner = THIS_MODULE,
net/ieee802154/af_ieee802154.c
... ... @@ -285,7 +285,7 @@
285 285 return rc;
286 286 }
287 287  
288   -static struct net_proto_family ieee802154_family_ops = {
  288 +static const struct net_proto_family ieee802154_family_ops = {
289 289 .family = PF_IEEE802154,
290 290 .create = ieee802154_create,
291 291 .owner = THIS_MODULE,
... ... @@ -931,7 +931,7 @@
931 931 #endif
932 932 };
933 933  
934   -static struct net_proto_family inet_family_ops = {
  934 +static const struct net_proto_family inet_family_ops = {
935 935 .family = PF_INET,
936 936 .create = inet_create,
937 937 .owner = THIS_MODULE,
... ... @@ -552,7 +552,7 @@
552 552 #endif
553 553 };
554 554  
555   -static struct net_proto_family inet6_family_ops = {
  555 +static const struct net_proto_family inet6_family_ops = {
556 556 .family = PF_INET6,
557 557 .create = inet6_create,
558 558 .owner = THIS_MODULE,
... ... @@ -1927,7 +1927,7 @@
1927 1927 * Socket family declarations
1928 1928 */
1929 1929  
1930   -static struct net_proto_family ipx_family_ops = {
  1930 +static const struct net_proto_family ipx_family_ops = {
1931 1931 .family = PF_IPX,
1932 1932 .create = ipx_create,
1933 1933 .owner = THIS_MODULE,
... ... @@ -2463,7 +2463,7 @@
2463 2463 return 0;
2464 2464 }
2465 2465  
2466   -static struct net_proto_family irda_family_ops = {
  2466 +static const struct net_proto_family irda_family_ops = {
2467 2467 .family = PF_IRDA,
2468 2468 .create = irda_create,
2469 2469 .owner = THIS_MODULE,
... ... @@ -1715,7 +1715,7 @@
1715 1715 .getsockopt = iucv_sock_getsockopt,
1716 1716 };
1717 1717  
1718   -static struct net_proto_family iucv_sock_family_ops = {
  1718 +static const struct net_proto_family iucv_sock_family_ops = {
1719 1719 .family = AF_IUCV,
1720 1720 .owner = THIS_MODULE,
1721 1721 .create = iucv_sock_create,
... ... @@ -3644,7 +3644,7 @@
3644 3644 .recvmsg = pfkey_recvmsg,
3645 3645 };
3646 3646  
3647   -static struct net_proto_family pfkey_family_ops = {
  3647 +static const struct net_proto_family pfkey_family_ops = {
3648 3648 .family = PF_KEY,
3649 3649 .create = pfkey_create,
3650 3650 .owner = THIS_MODULE,
... ... @@ -1092,7 +1092,7 @@
1092 1092 return rc;
1093 1093 }
1094 1094  
1095   -static struct net_proto_family llc_ui_family_ops = {
  1095 +static const struct net_proto_family llc_ui_family_ops = {
1096 1096 .family = PF_LLC,
1097 1097 .create = llc_ui_create,
1098 1098 .owner = THIS_MODULE,
net/netlink/af_netlink.c
... ... @@ -2050,7 +2050,7 @@
2050 2050 .sendpage = sock_no_sendpage,
2051 2051 };
2052 2052  
2053   -static struct net_proto_family netlink_family_ops = {
  2053 +static const struct net_proto_family netlink_family_ops = {
2054 2054 .family = PF_NETLINK,
2055 2055 .create = netlink_create,
2056 2056 .owner = THIS_MODULE, /* for consistency 8) */
net/netrom/af_netrom.c
... ... @@ -1372,7 +1372,7 @@
1372 1372 };
1373 1373 #endif /* CONFIG_PROC_FS */
1374 1374  
1375   -static struct net_proto_family nr_family_ops = {
  1375 +static const struct net_proto_family nr_family_ops = {
1376 1376 .family = PF_NETROM,
1377 1377 .create = nr_create,
1378 1378 .owner = THIS_MODULE,
net/packet/af_packet.c
... ... @@ -2399,7 +2399,7 @@
2399 2399 .sendpage = sock_no_sendpage,
2400 2400 };
2401 2401  
2402   -static struct net_proto_family packet_family_ops = {
  2402 +static const struct net_proto_family packet_family_ops = {
2403 2403 .family = PF_PACKET,
2404 2404 .create = packet_create,
2405 2405 .owner = THIS_MODULE,
net/phonet/af_phonet.c
... ... @@ -118,7 +118,7 @@
118 118 return err;
119 119 }
120 120  
121   -static struct net_proto_family phonet_proto_family = {
  121 +static const struct net_proto_family phonet_proto_family = {
122 122 .family = PF_PHONET,
123 123 .create = pn_socket_create,
124 124 .owner = THIS_MODULE,
... ... @@ -431,7 +431,7 @@
431 431 sock_put(rds_rs_to_sk(rs));
432 432 }
433 433  
434   -static struct net_proto_family rds_family_ops = {
  434 +static const struct net_proto_family rds_family_ops = {
435 435 .family = AF_RDS,
436 436 .create = rds_create,
437 437 .owner = THIS_MODULE,
... ... @@ -1509,7 +1509,7 @@
1509 1509 };
1510 1510 #endif /* CONFIG_PROC_FS */
1511 1511  
1512   -static struct net_proto_family rose_family_ops = {
  1512 +static const struct net_proto_family rose_family_ops = {
1513 1513 .family = PF_ROSE,
1514 1514 .create = rose_create,
1515 1515 .owner = THIS_MODULE,
net/rxrpc/af_rxrpc.c
... ... @@ -777,7 +777,7 @@
777 777 .max_header = sizeof(struct rxrpc_header),
778 778 };
779 779  
780   -static struct net_proto_family rxrpc_family_ops = {
  780 +static const struct net_proto_family rxrpc_family_ops = {
781 781 .family = PF_RXRPC,
782 782 .create = rxrpc_create,
783 783 .owner = THIS_MODULE,
... ... @@ -2214,7 +2214,7 @@
2214 2214  
2215 2215 #endif
2216 2216  
2217   -static struct net_proto_family unix_family_ops = {
  2217 +static const struct net_proto_family unix_family_ops = {
2218 2218 .family = PF_UNIX,
2219 2219 .create = unix_create,
2220 2220 .owner = THIS_MODULE,
... ... @@ -1476,7 +1476,7 @@
1476 1476 return rc;
1477 1477 }
1478 1478  
1479   -static struct net_proto_family x25_family_ops = {
  1479 +static const struct net_proto_family x25_family_ops = {
1480 1480 .family = AF_X25,
1481 1481 .create = x25_create,
1482 1482 .owner = THIS_MODULE,