aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-14 11:14:45 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-14 17:10:41 -0500
commitf84f771d942182e39a56ec2989d6a67d3ca33a13 (patch)
tree6649cb4e7b88ebec4826252a1a3675fb75ba4621 /include
parentd91824c08fbcb265ec930d863fa905e8daa836a4 (diff)
genetlink: allow making ops const
Allow making the ops array const by not modifying the ops flags on registration but rather only when ops are sent out in the family information. No users are updated yet except for the pre_doit/post_doit calls in wireless (the only ones that exist now.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/genetlink.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index d4802af1a8b3..d87486aa0611 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -52,14 +52,14 @@ struct genl_family {
52 unsigned int maxattr; 52 unsigned int maxattr;
53 bool netnsok; 53 bool netnsok;
54 bool parallel_ops; 54 bool parallel_ops;
55 int (*pre_doit)(struct genl_ops *ops, 55 int (*pre_doit)(const struct genl_ops *ops,
56 struct sk_buff *skb, 56 struct sk_buff *skb,
57 struct genl_info *info); 57 struct genl_info *info);
58 void (*post_doit)(struct genl_ops *ops, 58 void (*post_doit)(const struct genl_ops *ops,
59 struct sk_buff *skb, 59 struct sk_buff *skb,
60 struct genl_info *info); 60 struct genl_info *info);
61 struct nlattr ** attrbuf; /* private */ 61 struct nlattr ** attrbuf; /* private */
62 struct genl_ops * ops; /* private */ 62 const struct genl_ops * ops; /* private */
63 unsigned int n_ops; /* private */ 63 unsigned int n_ops; /* private */
64 struct list_head family_list; /* private */ 64 struct list_head family_list; /* private */
65 struct list_head mcast_groups; /* private */ 65 struct list_head mcast_groups; /* private */
@@ -132,10 +132,10 @@ static inline int genl_register_family(struct genl_family *family)
132} 132}
133 133
134int __genl_register_family_with_ops(struct genl_family *family, 134int __genl_register_family_with_ops(struct genl_family *family,
135 struct genl_ops *ops, size_t n_ops); 135 const struct genl_ops *ops, size_t n_ops);
136 136
137static inline int genl_register_family_with_ops(struct genl_family *family, 137static inline int genl_register_family_with_ops(struct genl_family *family,
138 struct genl_ops *ops, size_t n_ops) 138 const struct genl_ops *ops, size_t n_ops)
139{ 139{
140 family->module = THIS_MODULE; 140 family->module = THIS_MODULE;
141 return __genl_register_family_with_ops(family, ops, n_ops); 141 return __genl_register_family_with_ops(family, ops, n_ops);