mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
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>
This commit is contained in:
parent
f7734fdf61
commit
ec1b4cf74c
@ -808,8 +808,7 @@ mISDN_sock_create(struct net *net, struct socket *sock, int proto)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct
|
static const struct net_proto_family mISDN_sock_family_ops = {
|
||||||
net_proto_family mISDN_sock_family_ops = {
|
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.family = PF_ISDN,
|
.family = PF_ISDN,
|
||||||
.create = mISDN_sock_create,
|
.create = mISDN_sock_create,
|
||||||
|
@ -125,7 +125,7 @@ out:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family pppox_proto_family = {
|
static const struct net_proto_family pppox_proto_family = {
|
||||||
.family = PF_PPPOX,
|
.family = PF_PPPOX,
|
||||||
.create = pppox_create,
|
.create = pppox_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -121,7 +121,7 @@ struct bt_sock_list {
|
|||||||
rwlock_t lock;
|
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);
|
int bt_sock_unregister(int proto);
|
||||||
void bt_sock_link(struct bt_sock_list *l, struct sock *s);
|
void bt_sock_link(struct bt_sock_list *l, struct sock *s);
|
||||||
void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
|
void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
|
||||||
|
@ -1821,7 +1821,7 @@ static int atalk_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned lo
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static struct net_proto_family atalk_family_ops = {
|
static const struct net_proto_family atalk_family_ops = {
|
||||||
.family = PF_APPLETALK,
|
.family = PF_APPLETALK,
|
||||||
.create = atalk_create,
|
.create = atalk_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -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,
|
.family = PF_ATMPVC,
|
||||||
.create = pvc_create,
|
.create = pvc_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -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,
|
.family = PF_ATMSVC,
|
||||||
.create = svc_create,
|
.create = svc_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1961,7 +1961,7 @@ static const struct file_operations ax25_info_fops = {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct net_proto_family ax25_family_ops = {
|
static const struct net_proto_family ax25_family_ops = {
|
||||||
.family = PF_AX25,
|
.family = PF_AX25,
|
||||||
.create = ax25_create,
|
.create = ax25_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
/* Bluetooth sockets */
|
/* Bluetooth sockets */
|
||||||
#define BT_MAX_PROTO 8
|
#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 DEFINE_RWLOCK(bt_proto_lock);
|
||||||
|
|
||||||
static struct lock_class_key bt_lock_key[BT_MAX_PROTO];
|
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]);
|
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;
|
int err = 0;
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ static int bnep_sock_create(struct net *net, struct socket *sock, int protocol)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family bnep_sock_family_ops = {
|
static const struct net_proto_family bnep_sock_family_ops = {
|
||||||
.family = PF_BLUETOOTH,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = bnep_sock_create
|
.create = bnep_sock_create
|
||||||
|
@ -217,7 +217,7 @@ static int cmtp_sock_create(struct net *net, struct socket *sock, int protocol)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family cmtp_sock_family_ops = {
|
static const struct net_proto_family cmtp_sock_family_ops = {
|
||||||
.family = PF_BLUETOOTH,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = cmtp_sock_create
|
.create = cmtp_sock_create
|
||||||
|
@ -687,7 +687,7 @@ static int hci_sock_dev_event(struct notifier_block *this, unsigned long event,
|
|||||||
return NOTIFY_DONE;
|
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,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = hci_sock_create,
|
.create = hci_sock_create,
|
||||||
|
@ -268,7 +268,7 @@ static int hidp_sock_create(struct net *net, struct socket *sock, int protocol)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family hidp_sock_family_ops = {
|
static const struct net_proto_family hidp_sock_family_ops = {
|
||||||
.family = PF_BLUETOOTH,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = hidp_sock_create
|
.create = hidp_sock_create
|
||||||
|
@ -3916,7 +3916,7 @@ static const struct proto_ops l2cap_sock_ops = {
|
|||||||
.getsockopt = l2cap_sock_getsockopt
|
.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,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = l2cap_sock_create,
|
.create = l2cap_sock_create,
|
||||||
|
@ -1101,7 +1101,7 @@ static const struct proto_ops rfcomm_sock_ops = {
|
|||||||
.mmap = sock_no_mmap
|
.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,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = rfcomm_sock_create
|
.create = rfcomm_sock_create
|
||||||
|
@ -993,7 +993,7 @@ static const struct proto_ops sco_sock_ops = {
|
|||||||
.getsockopt = sco_sock_getsockopt
|
.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,
|
.family = PF_BLUETOOTH,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = sco_sock_create,
|
.create = sco_sock_create,
|
||||||
|
@ -842,7 +842,7 @@ static struct packet_type can_packet __read_mostly = {
|
|||||||
.func = can_rcv,
|
.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,
|
.family = PF_CAN,
|
||||||
.create = can_create,
|
.create = can_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -2325,7 +2325,7 @@ static const struct file_operations dn_socket_seq_fops = {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct net_proto_family dn_family_ops = {
|
static const struct net_proto_family dn_family_ops = {
|
||||||
.family = AF_DECnet,
|
.family = AF_DECnet,
|
||||||
.create = dn_create,
|
.create = dn_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -742,7 +742,7 @@ static int econet_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family econet_family_ops = {
|
static const struct net_proto_family econet_family_ops = {
|
||||||
.family = PF_ECONET,
|
.family = PF_ECONET,
|
||||||
.create = econet_create,
|
.create = econet_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -285,7 +285,7 @@ out:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family ieee802154_family_ops = {
|
static const struct net_proto_family ieee802154_family_ops = {
|
||||||
.family = PF_IEEE802154,
|
.family = PF_IEEE802154,
|
||||||
.create = ieee802154_create,
|
.create = ieee802154_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -931,7 +931,7 @@ static const struct proto_ops inet_sockraw_ops = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct net_proto_family inet_family_ops = {
|
static const struct net_proto_family inet_family_ops = {
|
||||||
.family = PF_INET,
|
.family = PF_INET,
|
||||||
.create = inet_create,
|
.create = inet_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -552,7 +552,7 @@ const struct proto_ops inet6_dgram_ops = {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct net_proto_family inet6_family_ops = {
|
static const struct net_proto_family inet6_family_ops = {
|
||||||
.family = PF_INET6,
|
.family = PF_INET6,
|
||||||
.create = inet6_create,
|
.create = inet6_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1927,7 +1927,7 @@ static int ipx_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long
|
|||||||
* Socket family declarations
|
* Socket family declarations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct net_proto_family ipx_family_ops = {
|
static const struct net_proto_family ipx_family_ops = {
|
||||||
.family = PF_IPX,
|
.family = PF_IPX,
|
||||||
.create = ipx_create,
|
.create = ipx_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -2463,7 +2463,7 @@ bed:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family irda_family_ops = {
|
static const struct net_proto_family irda_family_ops = {
|
||||||
.family = PF_IRDA,
|
.family = PF_IRDA,
|
||||||
.create = irda_create,
|
.create = irda_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1715,7 +1715,7 @@ static const struct proto_ops iucv_sock_ops = {
|
|||||||
.getsockopt = iucv_sock_getsockopt,
|
.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,
|
.family = AF_IUCV,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.create = iucv_sock_create,
|
.create = iucv_sock_create,
|
||||||
|
@ -3644,7 +3644,7 @@ static const struct proto_ops pfkey_ops = {
|
|||||||
.recvmsg = pfkey_recvmsg,
|
.recvmsg = pfkey_recvmsg,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct net_proto_family pfkey_family_ops = {
|
static const struct net_proto_family pfkey_family_ops = {
|
||||||
.family = PF_KEY,
|
.family = PF_KEY,
|
||||||
.create = pfkey_create,
|
.create = pfkey_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1092,7 +1092,7 @@ out:
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family llc_ui_family_ops = {
|
static const struct net_proto_family llc_ui_family_ops = {
|
||||||
.family = PF_LLC,
|
.family = PF_LLC,
|
||||||
.create = llc_ui_create,
|
.create = llc_ui_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -2050,7 +2050,7 @@ static const struct proto_ops netlink_ops = {
|
|||||||
.sendpage = sock_no_sendpage,
|
.sendpage = sock_no_sendpage,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct net_proto_family netlink_family_ops = {
|
static const struct net_proto_family netlink_family_ops = {
|
||||||
.family = PF_NETLINK,
|
.family = PF_NETLINK,
|
||||||
.create = netlink_create,
|
.create = netlink_create,
|
||||||
.owner = THIS_MODULE, /* for consistency 8) */
|
.owner = THIS_MODULE, /* for consistency 8) */
|
||||||
|
@ -1372,7 +1372,7 @@ static const struct file_operations nr_info_fops = {
|
|||||||
};
|
};
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
static struct net_proto_family nr_family_ops = {
|
static const struct net_proto_family nr_family_ops = {
|
||||||
.family = PF_NETROM,
|
.family = PF_NETROM,
|
||||||
.create = nr_create,
|
.create = nr_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -2399,7 +2399,7 @@ static const struct proto_ops packet_ops = {
|
|||||||
.sendpage = sock_no_sendpage,
|
.sendpage = sock_no_sendpage,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct net_proto_family packet_family_ops = {
|
static const struct net_proto_family packet_family_ops = {
|
||||||
.family = PF_PACKET,
|
.family = PF_PACKET,
|
||||||
.create = packet_create,
|
.create = packet_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -118,7 +118,7 @@ out:
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family phonet_proto_family = {
|
static const struct net_proto_family phonet_proto_family = {
|
||||||
.family = PF_PHONET,
|
.family = PF_PHONET,
|
||||||
.create = pn_socket_create,
|
.create = pn_socket_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -431,7 +431,7 @@ void rds_sock_put(struct rds_sock *rs)
|
|||||||
sock_put(rds_rs_to_sk(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,
|
.family = AF_RDS,
|
||||||
.create = rds_create,
|
.create = rds_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1509,7 +1509,7 @@ static const struct file_operations rose_info_fops = {
|
|||||||
};
|
};
|
||||||
#endif /* CONFIG_PROC_FS */
|
#endif /* CONFIG_PROC_FS */
|
||||||
|
|
||||||
static struct net_proto_family rose_family_ops = {
|
static const struct net_proto_family rose_family_ops = {
|
||||||
.family = PF_ROSE,
|
.family = PF_ROSE,
|
||||||
.create = rose_create,
|
.create = rose_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -777,7 +777,7 @@ static struct proto rxrpc_proto = {
|
|||||||
.max_header = sizeof(struct rxrpc_header),
|
.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,
|
.family = PF_RXRPC,
|
||||||
.create = rxrpc_create,
|
.create = rxrpc_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -2214,7 +2214,7 @@ static const struct file_operations unix_seq_fops = {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static struct net_proto_family unix_family_ops = {
|
static const struct net_proto_family unix_family_ops = {
|
||||||
.family = PF_UNIX,
|
.family = PF_UNIX,
|
||||||
.create = unix_create,
|
.create = unix_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
@ -1476,7 +1476,7 @@ static int x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct net_proto_family x25_family_ops = {
|
static const struct net_proto_family x25_family_ops = {
|
||||||
.family = AF_X25,
|
.family = AF_X25,
|
||||||
.create = x25_create,
|
.create = x25_create,
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
Loading…
Reference in New Issue
Block a user