diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-11-14 11:14:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-11-14 17:10:41 -0500 |
commit | 4534de8305b3f1460a527a0cda0e3dc2224c6f0c (patch) | |
tree | 8d140f8ea1c583a4f4ab4e7dc74a3d5dfdaa9ddc | |
parent | f84f771d942182e39a56ec2989d6a67d3ca33a13 (diff) |
genetlink: make all genl_ops users const
Now that genl_ops are no longer modified in place when
registering, they can be made const. This patch was done
mostly with spatch:
@@
identifier ops;
@@
+const
struct genl_ops ops[] = {
...
};
(except the struct thing in net/openvswitch/datapath.c)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/team/team.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 2 | ||||
-rw-r--r-- | kernel/taskstats.c | 2 | ||||
-rw-r--r-- | net/core/drop_monitor.c | 2 | ||||
-rw-r--r-- | net/hsr/hsr_netlink.c | 2 | ||||
-rw-r--r-- | net/ieee802154/netlink.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_metrics.c | 2 | ||||
-rw-r--r-- | net/irda/irnetlink.c | 2 | ||||
-rw-r--r-- | net/l2tp/l2tp_netlink.c | 2 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_cipso_v4.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_mgmt.c | 2 | ||||
-rw-r--r-- | net/netlabel/netlabel_unlabeled.c | 2 | ||||
-rw-r--r-- | net/nfc/netlink.c | 2 | ||||
-rw-r--r-- | net/openvswitch/datapath.c | 10 | ||||
-rw-r--r-- | net/wimax/stack.c | 2 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 2 |
17 files changed, 21 insertions, 21 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 50e43e64d51d..6390254beb7d 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -2644,7 +2644,7 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb, | |||
2644 | return err; | 2644 | return err; |
2645 | } | 2645 | } |
2646 | 2646 | ||
2647 | static struct genl_ops team_nl_ops[] = { | 2647 | static const struct genl_ops team_nl_ops[] = { |
2648 | { | 2648 | { |
2649 | .cmd = TEAM_CMD_NOOP, | 2649 | .cmd = TEAM_CMD_NOOP, |
2650 | .doit = team_nl_cmd_noop, | 2650 | .doit = team_nl_cmd_noop, |
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index de0df86704e7..cfc3fda79a2d 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -2097,7 +2097,7 @@ out: | |||
2097 | } | 2097 | } |
2098 | 2098 | ||
2099 | /* Generic Netlink operations array */ | 2099 | /* Generic Netlink operations array */ |
2100 | static struct genl_ops hwsim_ops[] = { | 2100 | static const struct genl_ops hwsim_ops[] = { |
2101 | { | 2101 | { |
2102 | .cmd = HWSIM_CMD_REGISTER, | 2102 | .cmd = HWSIM_CMD_REGISTER, |
2103 | .policy = hwsim_genl_policy, | 2103 | .policy = hwsim_genl_policy, |
diff --git a/kernel/taskstats.c b/kernel/taskstats.c index 609e77f68687..76595cd9d211 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c | |||
@@ -673,7 +673,7 @@ err: | |||
673 | nlmsg_free(rep_skb); | 673 | nlmsg_free(rep_skb); |
674 | } | 674 | } |
675 | 675 | ||
676 | static struct genl_ops taskstats_ops[] = { | 676 | static const struct genl_ops taskstats_ops[] = { |
677 | { | 677 | { |
678 | .cmd = TASKSTATS_CMD_GET, | 678 | .cmd = TASKSTATS_CMD_GET, |
679 | .doit = taskstats_user_cmd, | 679 | .doit = taskstats_user_cmd, |
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c index 5e78d44333b9..f9fe2f22d20b 100644 --- a/net/core/drop_monitor.c +++ b/net/core/drop_monitor.c | |||
@@ -333,7 +333,7 @@ out: | |||
333 | return NOTIFY_DONE; | 333 | return NOTIFY_DONE; |
334 | } | 334 | } |
335 | 335 | ||
336 | static struct genl_ops dropmon_ops[] = { | 336 | static const struct genl_ops dropmon_ops[] = { |
337 | { | 337 | { |
338 | .cmd = NET_DM_CMD_CONFIG, | 338 | .cmd = NET_DM_CMD_CONFIG, |
339 | .doit = net_dm_cmd_config, | 339 | .doit = net_dm_cmd_config, |
diff --git a/net/hsr/hsr_netlink.c b/net/hsr/hsr_netlink.c index 8f52a9fb7e85..79d72ca309ce 100644 --- a/net/hsr/hsr_netlink.c +++ b/net/hsr/hsr_netlink.c | |||
@@ -389,7 +389,7 @@ fail: | |||
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | static struct genl_ops hsr_ops[] = { | 392 | static const struct genl_ops hsr_ops[] = { |
393 | { | 393 | { |
394 | .cmd = HSR_C_GET_NODE_STATUS, | 394 | .cmd = HSR_C_GET_NODE_STATUS, |
395 | .flags = 0, | 395 | .flags = 0, |
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index eb9faef6782a..3ffcdbb56aab 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c | |||
@@ -109,7 +109,7 @@ out: | |||
109 | return -ENOBUFS; | 109 | return -ENOBUFS; |
110 | } | 110 | } |
111 | 111 | ||
112 | static struct genl_ops ieee8021154_ops[] = { | 112 | static const struct genl_ops ieee8021154_ops[] = { |
113 | /* see nl-phy.c */ | 113 | /* see nl-phy.c */ |
114 | IEEE802154_DUMP(IEEE802154_LIST_PHY, ieee802154_list_phy, | 114 | IEEE802154_DUMP(IEEE802154_LIST_PHY, ieee802154_list_phy, |
115 | ieee802154_dump_phy), | 115 | ieee802154_dump_phy), |
diff --git a/net/ipv4/tcp_metrics.c b/net/ipv4/tcp_metrics.c index d3ee2e0c28b6..8c121b523eee 100644 --- a/net/ipv4/tcp_metrics.c +++ b/net/ipv4/tcp_metrics.c | |||
@@ -991,7 +991,7 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info) | |||
991 | return 0; | 991 | return 0; |
992 | } | 992 | } |
993 | 993 | ||
994 | static struct genl_ops tcp_metrics_nl_ops[] = { | 994 | static const struct genl_ops tcp_metrics_nl_ops[] = { |
995 | { | 995 | { |
996 | .cmd = TCP_METRICS_CMD_GET, | 996 | .cmd = TCP_METRICS_CMD_GET, |
997 | .doit = tcp_metrics_nl_cmd_get, | 997 | .doit = tcp_metrics_nl_cmd_get, |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index c32971269280..bf5d7d476dae 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
@@ -131,7 +131,7 @@ static const struct nla_policy irda_nl_policy[IRDA_NL_ATTR_MAX + 1] = { | |||
131 | [IRDA_NL_ATTR_MODE] = { .type = NLA_U32 }, | 131 | [IRDA_NL_ATTR_MODE] = { .type = NLA_U32 }, |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static struct genl_ops irda_nl_ops[] = { | 134 | static const struct genl_ops irda_nl_ops[] = { |
135 | { | 135 | { |
136 | .cmd = IRDA_NL_CMD_SET_MODE, | 136 | .cmd = IRDA_NL_CMD_SET_MODE, |
137 | .doit = irda_nl_set_mode, | 137 | .doit = irda_nl_set_mode, |
diff --git a/net/l2tp/l2tp_netlink.c b/net/l2tp/l2tp_netlink.c index be446d517bc9..57db66e24f1f 100644 --- a/net/l2tp/l2tp_netlink.c +++ b/net/l2tp/l2tp_netlink.c | |||
@@ -793,7 +793,7 @@ static struct nla_policy l2tp_nl_policy[L2TP_ATTR_MAX + 1] = { | |||
793 | }, | 793 | }, |
794 | }; | 794 | }; |
795 | 795 | ||
796 | static struct genl_ops l2tp_nl_ops[] = { | 796 | static const struct genl_ops l2tp_nl_ops[] = { |
797 | { | 797 | { |
798 | .cmd = L2TP_CMD_NOOP, | 798 | .cmd = L2TP_CMD_NOOP, |
799 | .doit = l2tp_nl_cmd_noop, | 799 | .doit = l2tp_nl_cmd_noop, |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 62786a495cea..fc8a04ed8854 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -3567,7 +3567,7 @@ out: | |||
3567 | } | 3567 | } |
3568 | 3568 | ||
3569 | 3569 | ||
3570 | static struct genl_ops ip_vs_genl_ops[] __read_mostly = { | 3570 | static const struct genl_ops ip_vs_genl_ops[] __read_mostly = { |
3571 | { | 3571 | { |
3572 | .cmd = IPVS_CMD_NEW_SERVICE, | 3572 | .cmd = IPVS_CMD_NEW_SERVICE, |
3573 | .flags = GENL_ADMIN_PERM, | 3573 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/netlabel/netlabel_cipso_v4.c b/net/netlabel/netlabel_cipso_v4.c index a1100640495d..706691739b99 100644 --- a/net/netlabel/netlabel_cipso_v4.c +++ b/net/netlabel/netlabel_cipso_v4.c | |||
@@ -737,7 +737,7 @@ static int netlbl_cipsov4_remove(struct sk_buff *skb, struct genl_info *info) | |||
737 | * NetLabel Generic NETLINK Command Definitions | 737 | * NetLabel Generic NETLINK Command Definitions |
738 | */ | 738 | */ |
739 | 739 | ||
740 | static struct genl_ops netlbl_cipsov4_ops[] = { | 740 | static const struct genl_ops netlbl_cipsov4_ops[] = { |
741 | { | 741 | { |
742 | .cmd = NLBL_CIPSOV4_C_ADD, | 742 | .cmd = NLBL_CIPSOV4_C_ADD, |
743 | .flags = GENL_ADMIN_PERM, | 743 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index dd1c37d7acbc..7de6f660b80a 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -705,7 +705,7 @@ version_failure: | |||
705 | * NetLabel Generic NETLINK Command Definitions | 705 | * NetLabel Generic NETLINK Command Definitions |
706 | */ | 706 | */ |
707 | 707 | ||
708 | static struct genl_ops netlbl_mgmt_genl_ops[] = { | 708 | static const struct genl_ops netlbl_mgmt_genl_ops[] = { |
709 | { | 709 | { |
710 | .cmd = NLBL_MGMT_C_ADD, | 710 | .cmd = NLBL_MGMT_C_ADD, |
711 | .flags = GENL_ADMIN_PERM, | 711 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/netlabel/netlabel_unlabeled.c b/net/netlabel/netlabel_unlabeled.c index 8f0897407a2c..76ee9252daa7 100644 --- a/net/netlabel/netlabel_unlabeled.c +++ b/net/netlabel/netlabel_unlabeled.c | |||
@@ -1323,7 +1323,7 @@ unlabel_staticlistdef_return: | |||
1323 | * NetLabel Generic NETLINK Command Definitions | 1323 | * NetLabel Generic NETLINK Command Definitions |
1324 | */ | 1324 | */ |
1325 | 1325 | ||
1326 | static struct genl_ops netlbl_unlabel_genl_ops[] = { | 1326 | static const struct genl_ops netlbl_unlabel_genl_ops[] = { |
1327 | { | 1327 | { |
1328 | .cmd = NLBL_UNLABEL_C_STATICADD, | 1328 | .cmd = NLBL_UNLABEL_C_STATICADD, |
1329 | .flags = GENL_ADMIN_PERM, | 1329 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index 84b7e3ea7b7a..f5585611c098 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
@@ -1364,7 +1364,7 @@ static int nfc_genl_se_io(struct sk_buff *skb, struct genl_info *info) | |||
1364 | return dev->ops->se_io(dev, se_idx, apdu, apdu_len, se_io_cb, ctx); | 1364 | return dev->ops->se_io(dev, se_idx, apdu, apdu_len, se_io_cb, ctx); |
1365 | } | 1365 | } |
1366 | 1366 | ||
1367 | static struct genl_ops nfc_genl_ops[] = { | 1367 | static const struct genl_ops nfc_genl_ops[] = { |
1368 | { | 1368 | { |
1369 | .cmd = NFC_CMD_GET_DEVICE, | 1369 | .cmd = NFC_CMD_GET_DEVICE, |
1370 | .doit = nfc_genl_get_device, | 1370 | .doit = nfc_genl_get_device, |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 1408adc2a2a7..91e1c927a465 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
@@ -557,7 +557,7 @@ static const struct nla_policy packet_policy[OVS_PACKET_ATTR_MAX + 1] = { | |||
557 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, | 557 | [OVS_PACKET_ATTR_ACTIONS] = { .type = NLA_NESTED }, |
558 | }; | 558 | }; |
559 | 559 | ||
560 | static struct genl_ops dp_packet_genl_ops[] = { | 560 | static const struct genl_ops dp_packet_genl_ops[] = { |
561 | { .cmd = OVS_PACKET_CMD_EXECUTE, | 561 | { .cmd = OVS_PACKET_CMD_EXECUTE, |
562 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 562 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
563 | .policy = packet_policy, | 563 | .policy = packet_policy, |
@@ -1034,7 +1034,7 @@ static int ovs_flow_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1034 | return skb->len; | 1034 | return skb->len; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static struct genl_ops dp_flow_genl_ops[] = { | 1037 | static const struct genl_ops dp_flow_genl_ops[] = { |
1038 | { .cmd = OVS_FLOW_CMD_NEW, | 1038 | { .cmd = OVS_FLOW_CMD_NEW, |
1039 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1039 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
1040 | .policy = flow_policy, | 1040 | .policy = flow_policy, |
@@ -1392,7 +1392,7 @@ static int ovs_dp_cmd_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
1392 | return skb->len; | 1392 | return skb->len; |
1393 | } | 1393 | } |
1394 | 1394 | ||
1395 | static struct genl_ops dp_datapath_genl_ops[] = { | 1395 | static const struct genl_ops dp_datapath_genl_ops[] = { |
1396 | { .cmd = OVS_DP_CMD_NEW, | 1396 | { .cmd = OVS_DP_CMD_NEW, |
1397 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1397 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
1398 | .policy = datapath_policy, | 1398 | .policy = datapath_policy, |
@@ -1753,7 +1753,7 @@ out: | |||
1753 | return skb->len; | 1753 | return skb->len; |
1754 | } | 1754 | } |
1755 | 1755 | ||
1756 | static struct genl_ops dp_vport_genl_ops[] = { | 1756 | static const struct genl_ops dp_vport_genl_ops[] = { |
1757 | { .cmd = OVS_VPORT_CMD_NEW, | 1757 | { .cmd = OVS_VPORT_CMD_NEW, |
1758 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ | 1758 | .flags = GENL_ADMIN_PERM, /* Requires CAP_NET_ADMIN privilege. */ |
1759 | .policy = vport_policy, | 1759 | .policy = vport_policy, |
@@ -1779,7 +1779,7 @@ static struct genl_ops dp_vport_genl_ops[] = { | |||
1779 | 1779 | ||
1780 | struct genl_family_and_ops { | 1780 | struct genl_family_and_ops { |
1781 | struct genl_family *family; | 1781 | struct genl_family *family; |
1782 | struct genl_ops *ops; | 1782 | const struct genl_ops *ops; |
1783 | int n_ops; | 1783 | int n_ops; |
1784 | struct genl_multicast_group *group; | 1784 | struct genl_multicast_group *group; |
1785 | }; | 1785 | }; |
diff --git a/net/wimax/stack.c b/net/wimax/stack.c index 4b7f15a50087..47170c9495f1 100644 --- a/net/wimax/stack.c +++ b/net/wimax/stack.c | |||
@@ -415,7 +415,7 @@ static const struct nla_policy wimax_gnl_policy[WIMAX_GNL_ATTR_MAX + 1] = { | |||
415 | }, | 415 | }, |
416 | }; | 416 | }; |
417 | 417 | ||
418 | static struct genl_ops wimax_gnl_ops[] = { | 418 | static const struct genl_ops wimax_gnl_ops[] = { |
419 | { | 419 | { |
420 | .cmd = WIMAX_GNL_OP_MSG_FROM_USER, | 420 | .cmd = WIMAX_GNL_OP_MSG_FROM_USER, |
421 | .flags = GENL_ADMIN_PERM, | 421 | .flags = GENL_ADMIN_PERM, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 3fef55958e98..58c43c8e149f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -8937,7 +8937,7 @@ static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb, | |||
8937 | rtnl_unlock(); | 8937 | rtnl_unlock(); |
8938 | } | 8938 | } |
8939 | 8939 | ||
8940 | static struct genl_ops nl80211_ops[] = { | 8940 | static const struct genl_ops nl80211_ops[] = { |
8941 | { | 8941 | { |
8942 | .cmd = NL80211_CMD_GET_WIPHY, | 8942 | .cmd = NL80211_CMD_GET_WIPHY, |
8943 | .doit = nl80211_get_wiphy, | 8943 | .doit = nl80211_get_wiphy, |