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 /net/openvswitch | |
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>
Diffstat (limited to 'net/openvswitch')
-rw-r--r-- | net/openvswitch/datapath.c | 10 |
1 files changed, 5 insertions, 5 deletions
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 | }; |