aboutsummaryrefslogtreecommitdiffstats
path: root/net/wimax/op-msg.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-14 11:14:42 -0500
committerDavid S. Miller <davem@davemloft.net>2013-11-14 17:10:40 -0500
commitb61a5eea5904198d45e775c342be010a23decbe3 (patch)
tree1b1a6b78601a8d414a46344e1f3ef9ab5fae510e /net/wimax/op-msg.c
parent1c582d915da13ca21ad375ae04ec1bd6193418b2 (diff)
wimax: use genl_register_family_with_ops()
This simplifies the code since there's no longer a need to have error handling in the registration. Unfortunately it means more extern function declarations are needed, but the overall goal would seem to justify this. Due to the removal of duplication in the netlink policies, this reduces the size of wimax by almost 1k. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/wimax/op-msg.c')
-rw-r--r--net/wimax/op-msg.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/net/wimax/op-msg.c b/net/wimax/op-msg.c
index 0694d62e4dbc..ff19cbeaf607 100644
--- a/net/wimax/op-msg.c
+++ b/net/wimax/op-msg.c
@@ -321,17 +321,6 @@ int wimax_msg(struct wimax_dev *wimax_dev, const char *pipe_name,
321} 321}
322EXPORT_SYMBOL_GPL(wimax_msg); 322EXPORT_SYMBOL_GPL(wimax_msg);
323 323
324
325static const struct nla_policy wimax_gnl_msg_policy[WIMAX_GNL_ATTR_MAX + 1] = {
326 [WIMAX_GNL_MSG_IFIDX] = {
327 .type = NLA_U32,
328 },
329 [WIMAX_GNL_MSG_DATA] = {
330 .type = NLA_UNSPEC, /* libnl doesn't grok BINARY yet */
331 },
332};
333
334
335/* 324/*
336 * Relays a message from user space to the driver 325 * Relays a message from user space to the driver
337 * 326 *
@@ -340,7 +329,6 @@ static const struct nla_policy wimax_gnl_msg_policy[WIMAX_GNL_ATTR_MAX + 1] = {
340 * 329 *
341 * This call will block while handling/relaying the message. 330 * This call will block while handling/relaying the message.
342 */ 331 */
343static
344int wimax_gnl_doit_msg_from_user(struct sk_buff *skb, struct genl_info *info) 332int wimax_gnl_doit_msg_from_user(struct sk_buff *skb, struct genl_info *info)
345{ 333{
346 int result, ifindex; 334 int result, ifindex;
@@ -418,16 +406,3 @@ error_no_wimax_dev:
418 return result; 406 return result;
419} 407}
420 408
421
422/*
423 * Generic Netlink glue
424 */
425
426struct genl_ops wimax_gnl_msg_from_user = {
427 .cmd = WIMAX_GNL_OP_MSG_FROM_USER,
428 .flags = GENL_ADMIN_PERM,
429 .policy = wimax_gnl_msg_policy,
430 .doit = wimax_gnl_doit_msg_from_user,
431 .dumpit = NULL,
432};
433