net: mark net_proto_ops as const
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 5 Oct 2009 05:58:39 +0000 (05:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Oct 2009 08:10:46 +0000 (01:10 -0700)
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>
35 files changed:
drivers/isdn/mISDN/socket.c
drivers/net/pppox.c
include/net/bluetooth/bluetooth.h
net/appletalk/ddp.c
net/atm/pvc.c
net/atm/svc.c
net/ax25/af_ax25.c
net/bluetooth/af_bluetooth.c
net/bluetooth/bnep/sock.c
net/bluetooth/cmtp/sock.c
net/bluetooth/hci_sock.c
net/bluetooth/hidp/sock.c
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c
net/can/af_can.c
net/decnet/af_decnet.c
net/econet/af_econet.c
net/ieee802154/af_ieee802154.c
net/ipv4/af_inet.c
net/ipv6/af_inet6.c
net/ipx/af_ipx.c
net/irda/af_irda.c
net/iucv/af_iucv.c
net/key/af_key.c
net/llc/af_llc.c
net/netlink/af_netlink.c
net/netrom/af_netrom.c
net/packet/af_packet.c
net/phonet/af_phonet.c
net/rds/af_rds.c
net/rose/af_rose.c
net/rxrpc/af_rxrpc.c
net/unix/af_unix.c
net/x25/af_x25.c

index feb0fa45b664b7f30f843d8097fc47013be8adce..28182ed8dea175e272874e1f8b105865615d5172 100644 (file)
@@ -808,8 +808,7 @@ mISDN_sock_create(struct net *net, struct socket *sock, int proto)
        return err;
 }
 
-static struct
-net_proto_family mISDN_sock_family_ops = {
+static const struct net_proto_family mISDN_sock_family_ops = {
        .owner  = THIS_MODULE,
        .family = PF_ISDN,
        .create = mISDN_sock_create,
index 4f6d33fbc673ccb45a95cc56ebe915b712d3b07e..c14ee24c05a87f49c48a04eb89b80860620c84ad 100644 (file)
@@ -125,7 +125,7 @@ out:
        return rc;
 }
 
-static struct net_proto_family pppox_proto_family = {
+static const struct net_proto_family pppox_proto_family = {
        .family = PF_PPPOX,
        .create = pppox_create,
        .owner  = THIS_MODULE,
index 718394e2c01e6665331a7aa5a03eddff0bd94845..04a6908e38d2883a136a60c92ddb1405e1d1ff60 100644 (file)
@@ -121,7 +121,7 @@ struct bt_sock_list {
        rwlock_t          lock;
 };
 
-int  bt_sock_register(int proto, struct net_proto_family *ops);
+int  bt_sock_register(int proto, const struct net_proto_family *ops);
 int  bt_sock_unregister(int proto);
 void bt_sock_link(struct bt_sock_list *l, struct sock *s);
 void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
index b1a4290996b511ebc644e86ab9b7aeb693e74db8..abe38014b7fd894538e0edfa79eaf5faf8198ccb 100644 (file)
@@ -1821,7 +1821,7 @@ static int atalk_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned lo
 #endif
 
 
-static struct net_proto_family atalk_family_ops = {
+static const struct net_proto_family atalk_family_ops = {
        .family         = PF_APPLETALK,
        .create         = atalk_create,
        .owner          = THIS_MODULE,
index d4c024504f998b719d7cdb47a52abaa8830be44d..a6e1fdbae87fac418e8295cade7b7c6ebe53a2bf 100644 (file)
@@ -137,7 +137,7 @@ static int pvc_create(struct net *net, struct socket *sock,int protocol)
 }
 
 
-static struct net_proto_family pvc_family_ops = {
+static const struct net_proto_family pvc_family_ops = {
        .family = PF_ATMPVC,
        .create = pvc_create,
        .owner = THIS_MODULE,
index f90d143c4b2592d6ed2145724d580911b9839c28..8193542333181fd694628ea3512208944adf3a9d 100644 (file)
@@ -666,7 +666,7 @@ static int svc_create(struct net *net, struct socket *sock,int protocol)
 }
 
 
-static struct net_proto_family svc_family_ops = {
+static const struct net_proto_family svc_family_ops = {
        .family = PF_ATMSVC,
        .create = svc_create,
        .owner = THIS_MODULE,
index f454607303717d2f1339cfd901e6b2ae5ec8437f..f05306f168fa45237e6defcb9f7fc58b6f5f25e4 100644 (file)
@@ -1961,7 +1961,7 @@ static const struct file_operations ax25_info_fops = {
 
 #endif
 
-static struct net_proto_family ax25_family_ops = {
+static const struct net_proto_family ax25_family_ops = {
        .family =       PF_AX25,
        .create =       ax25_create,
        .owner  =       THIS_MODULE,
index 8cfb5a8498412461fa52278a8a94423580167de6..1f6e49c1cde8dec2a75c09acc607a4a8d0ebaa3a 100644 (file)
@@ -45,7 +45,7 @@
 
 /* Bluetooth sockets */
 #define BT_MAX_PROTO   8
-static struct net_proto_family *bt_proto[BT_MAX_PROTO];
+static const struct net_proto_family *bt_proto[BT_MAX_PROTO];
 static DEFINE_RWLOCK(bt_proto_lock);
 
 static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
@@ -86,7 +86,7 @@ static inline void bt_sock_reclassify_lock(struct socket *sock, int proto)
                                bt_key_strings[proto], &bt_lock_key[proto]);
 }
 
-int bt_sock_register(int proto, struct net_proto_family *ops)
+int bt_sock_register(int proto, const struct net_proto_family *ops)
 {
        int err = 0;
 
index e857628b0b27e61234102dc843ab0cc84a5f5c42..0a2c5460bb48cd7f8af1c9c87ecda6a9b90cfa2a 100644 (file)
@@ -222,7 +222,7 @@ static int bnep_sock_create(struct net *net, struct socket *sock, int protocol)
        return 0;
 }
 
-static struct net_proto_family bnep_sock_family_ops = {
+static const struct net_proto_family bnep_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = bnep_sock_create
index 16b0fad74f6e82d6a9ec0f5c98725a50fd89757a..de7c8040bc5642bf16521010e0d006fadc506342 100644 (file)
@@ -217,7 +217,7 @@ static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol)
        return 0;
 }
 
-static struct net_proto_family cmtp_sock_family_ops = {
+static const struct net_proto_family cmtp_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = cmtp_sock_create
index 75302a986067daebc76e4fba40c9c6a92d6de3bf..e7395f2319897312eb0428df974241e32bd27998 100644 (file)
@@ -687,7 +687,7 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
        return NOTIFY_DONE;
 }
 
-static struct net_proto_family hci_sock_family_ops = {
+static const struct net_proto_family hci_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = hci_sock_create,
index 37c9d7d2e688ba35279f310707597c04f26d96b9..4beb6a7a2953fe3d2a997434d344297667609aa8 100644 (file)
@@ -268,7 +268,7 @@ static int hidp_sock_create(struct net *net, struct socket *sock, int protocol)
        return 0;
 }
 
-static struct net_proto_family hidp_sock_family_ops = {
+static const struct net_proto_family hidp_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = hidp_sock_create
index 555d9da1869b2fa3daca87eef3f88974a6edb0c8..4b66bd579f4ace4c58603eef37a7e7a2e5272b65 100644 (file)
@@ -3916,7 +3916,7 @@ static const struct proto_ops l2cap_sock_ops = {
        .getsockopt     = l2cap_sock_getsockopt
 };
 
-static struct net_proto_family l2cap_sock_family_ops = {
+static const struct net_proto_family l2cap_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = l2cap_sock_create,
index 8a20aaf1f2316676564501c49bb59c3fe56c898b..c7078650385022ab232c5369e08cd7374e13b03b 100644 (file)
@@ -1101,7 +1101,7 @@ static const struct proto_ops rfcomm_sock_ops = {
        .mmap           = sock_no_mmap
 };
 
-static struct net_proto_family rfcomm_sock_family_ops = {
+static const struct net_proto_family rfcomm_sock_family_ops = {
        .family         = PF_BLUETOOTH,
        .owner          = THIS_MODULE,
        .create         = rfcomm_sock_create
index 77f4153bdb5e5ebe434487497d1e8d3ed0253cbf..694a65541b73a2ca39af4327c62840aa73723f44 100644 (file)
@@ -993,7 +993,7 @@ static const struct proto_ops sco_sock_ops = {
        .getsockopt     = sco_sock_getsockopt
 };
 
-static struct net_proto_family sco_sock_family_ops = {
+static const struct net_proto_family sco_sock_family_ops = {
        .family = PF_BLUETOOTH,
        .owner  = THIS_MODULE,
        .create = sco_sock_create,
index 606832115674147be25d49bea7f12ce293b9bc2a..3f2eb27e1ffb1e8f31bd2346220ec2611a6f45df 100644 (file)
@@ -842,7 +842,7 @@ static struct packet_type can_packet __read_mostly = {
        .func = can_rcv,
 };
 
-static struct net_proto_family can_family_ops __read_mostly = {
+static const struct net_proto_family can_family_ops = {
        .family = PF_CAN,
        .create = can_create,
        .owner  = THIS_MODULE,
index 7a58c87baf172f9384fab475f8243eab58716e58..4d3060660a14891b7709600d4d2cecb3b064219c 100644 (file)
@@ -2325,7 +2325,7 @@ static const struct file_operations dn_socket_seq_fops = {
 };
 #endif
 
-static struct net_proto_family dn_family_ops = {
+static const struct net_proto_family   dn_family_ops = {
        .family =       AF_DECnet,
        .create =       dn_create,
        .owner  =       THIS_MODULE,
index 0e0254fd767de359769b080ff4bacdcb12c52eb4..6529be3a18b7968e83652dcab05ac9edaacd1d3e 100644 (file)
@@ -742,7 +742,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg
        return 0;
 }
 
-static struct net_proto_family econet_family_ops = {
+static const struct net_proto_family econet_family_ops = {
        .family =       PF_ECONET,
        .create =       econet_create,
        .owner  =       THIS_MODULE,
index cd949d5e451bb422fb11b7b6473acc3c38cb1aa7..309348fba72b850e4049f990a75662d3501b0292 100644 (file)
@@ -285,7 +285,7 @@ out:
        return rc;
 }
 
-static struct net_proto_family ieee802154_family_ops = {
+static const struct net_proto_family ieee802154_family_ops = {
        .family         = PF_IEEE802154,
        .create         = ieee802154_create,
        .owner          = THIS_MODULE,
index 57737b8d1711a9348ca7000963eb4e65f3680db7..1deff48b122e2756f6e5fb1462a23eab72c69634 100644 (file)
@@ -931,7 +931,7 @@ static const struct proto_ops inet_sockraw_ops = {
 #endif
 };
 
-static struct net_proto_family inet_family_ops = {
+static const struct net_proto_family inet_family_ops = {
        .family = PF_INET,
        .create = inet_create,
        .owner  = THIS_MODULE,
index da36497ae6478b25ee7f8f59e9e0c95a21515eeb..94216519873c78c70af8a35fbfdaae456d1ebc70 100644 (file)
@@ -552,7 +552,7 @@ const struct proto_ops inet6_dgram_ops = {
 #endif
 };
 
-static struct net_proto_family inet6_family_ops = {
+static const struct net_proto_family inet6_family_ops = {
        .family = PF_INET6,
        .create = inet6_create,
        .owner  = THIS_MODULE,
index 66c7a20011f36b3147bb66c5169f5c292236f597..6481ee4bdf7231db11e1dd2a51d16d27cb1a9d68 100644 (file)
@@ -1927,7 +1927,7 @@ static int ipx_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long
  * Socket family declarations
  */
 
-static struct net_proto_family ipx_family_ops = {
+static const struct net_proto_family ipx_family_ops = {
        .family         = PF_IPX,
        .create         = ipx_create,
        .owner          = THIS_MODULE,
index dd35641835f408d161a7d1c70550a15f1a0309ac..9429e4002bcace9b51480b69865b73f3fc334193 100644 (file)
@@ -2463,7 +2463,7 @@ bed:
        return 0;
 }
 
-static struct net_proto_family irda_family_ops = {
+static const struct net_proto_family irda_family_ops = {
        .family = PF_IRDA,
        .create = irda_create,
        .owner  = THIS_MODULE,
index bada1b9c670bd555fa10833165326492762b3d97..004134b60d8620d9faadc09f21166ca437d77997 100644 (file)
@@ -1715,7 +1715,7 @@ static const struct proto_ops iucv_sock_ops = {
        .getsockopt     = iucv_sock_getsockopt,
 };
 
-static struct net_proto_family iucv_sock_family_ops = {
+static const struct net_proto_family iucv_sock_family_ops = {
        .family = AF_IUCV,
        .owner  = THIS_MODULE,
        .create = iucv_sock_create,
index 4e98193dfa0fcd05532a18c7b8ff3a0e832ace5e..c078ae6e975b6ab5bfee6fcc5ede535b18878fb8 100644 (file)
@@ -3644,7 +3644,7 @@ static const struct proto_ops pfkey_ops = {
        .recvmsg        =       pfkey_recvmsg,
 };
 
-static struct net_proto_family pfkey_family_ops = {
+static const struct net_proto_family pfkey_family_ops = {
        .family =       PF_KEY,
        .create =       pfkey_create,
        .owner  =       THIS_MODULE,
index 7aa4fd170104452be2d9daa1194bc313dfd759eb..4866b4fb0c2785d02135e310092af9399ac18748 100644 (file)
@@ -1092,7 +1092,7 @@ out:
        return rc;
 }
 
-static struct net_proto_family llc_ui_family_ops = {
+static const struct net_proto_family llc_ui_family_ops = {
        .family = PF_LLC,
        .create = llc_ui_create,
        .owner  = THIS_MODULE,
index 19e98007691cce17b68e3fc29896b7dc3626a526..0cd2d88293136c271f72df7f1a4478919f448a06 100644 (file)
@@ -2050,7 +2050,7 @@ static const struct proto_ops netlink_ops = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct net_proto_family netlink_family_ops = {
+static const struct net_proto_family netlink_family_ops = {
        .family = PF_NETLINK,
        .create = netlink_create,
        .owner  = THIS_MODULE,  /* for consistency 8) */
index 7a834952f67fe75f72558b7e3c8477bc8ac259a6..281fa597cae5cafb45fed9677c819d3ccaaf8f79 100644 (file)
@@ -1372,7 +1372,7 @@ static const struct file_operations nr_info_fops = {
 };
 #endif /* CONFIG_PROC_FS */
 
-static struct net_proto_family nr_family_ops = {
+static const struct net_proto_family nr_family_ops = {
        .family         =       PF_NETROM,
        .create         =       nr_create,
        .owner          =       THIS_MODULE,
index efc1174af7169a8eff2d7d89e576daf8c8e0e918..70073a0dea5d5fe7a4d6d2e5d625a363db04f988 100644 (file)
@@ -2399,7 +2399,7 @@ static const struct proto_ops packet_ops = {
        .sendpage =     sock_no_sendpage,
 };
 
-static struct net_proto_family packet_family_ops = {
+static const struct net_proto_family packet_family_ops = {
        .family =       PF_PACKET,
        .create =       packet_create,
        .owner  =       THIS_MODULE,
index f60c0c2aacba5f1a99fe4a2fe159f43a09b78f07..c711d58b4bb56cbca679da5e73a60c7e6feaac06 100644 (file)
@@ -118,7 +118,7 @@ out:
        return err;
 }
 
-static struct net_proto_family phonet_proto_family = {
+static const struct net_proto_family phonet_proto_family = {
        .family = PF_PHONET,
        .create = pn_socket_create,
        .owner = THIS_MODULE,
index 98e05382fd3cf19e01fe2315674e0e84ff8da145..a202e5b36079892b1581f5db0b3c1617608caff7 100644 (file)
@@ -431,7 +431,7 @@ void rds_sock_put(struct rds_sock *rs)
        sock_put(rds_rs_to_sk(rs));
 }
 
-static struct net_proto_family rds_family_ops = {
+static const struct net_proto_family rds_family_ops = {
        .family =       AF_RDS,
        .create =       rds_create,
        .owner  =       THIS_MODULE,
index 502cce76621d07abdd624798c5c76e3802db63aa..c17734c2ce8936f488619ea7ef14b2bebe9e79cb 100644 (file)
@@ -1509,7 +1509,7 @@ static const struct file_operations rose_info_fops = {
 };
 #endif /* CONFIG_PROC_FS */
 
-static struct net_proto_family rose_family_ops = {
+static const struct net_proto_family rose_family_ops = {
        .family         =       PF_ROSE,
        .create         =       rose_create,
        .owner          =       THIS_MODULE,
index a86afceaa94fadd8a1137c7688a03cb5714cf18e..6817c9781ef35b0385268a3fc50bf213a5a24db7 100644 (file)
@@ -777,7 +777,7 @@ static struct proto rxrpc_proto = {
        .max_header     = sizeof(struct rxrpc_header),
 };
 
-static struct net_proto_family rxrpc_family_ops = {
+static const struct net_proto_family rxrpc_family_ops = {
        .family = PF_RXRPC,
        .create = rxrpc_create,
        .owner  = THIS_MODULE,
index 51ab497115eb7eda412870a895a8e2197adbffca..0f133c5a8d3c2a89ea1e045112e82d9f9b7d8d54 100644 (file)
@@ -2214,7 +2214,7 @@ static const struct file_operations unix_seq_fops = {
 
 #endif
 
-static struct net_proto_family unix_family_ops = {
+static const struct net_proto_family unix_family_ops = {
        .family = PF_UNIX,
        .create = unix_create,
        .owner  = THIS_MODULE,
index 7fa9c7ad3d3b5b7efbe4c612511425628900a138..ebbfe6bbbff98ddde3f7c4fbb44babb5fd38b11c 100644 (file)
@@ -1476,7 +1476,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
        return rc;
 }
 
-static struct net_proto_family x25_family_ops = {
+static const struct net_proto_family x25_family_ops = {
        .family =       AF_X25,
        .create =       x25_create,
        .owner  =       THIS_MODULE,