aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDenis ChengRq <crquan@gmail.com>2014-06-02 04:18:01 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-02 13:36:18 -0400
commit2f91abd4516da0cadfb955c963b16f96e2e6c07a (patch)
tree551d9c8f4bfe699eeb731f108e3842d9498c5144 /net
parent96b2e73c5471542cb9c622c4360716684f8797ed (diff)
genetlink: remove superfluous assignment
the local variable ops and n_ops were just read out from family, and not changed, hence no need to assign back. Validation functions should operate on const parameters and not change anything. Signed-off-by: Cheng Renquan <crquan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/netlink/genetlink.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
index a3ba3ca0ff92..76393f2f4b22 100644
--- a/net/netlink/genetlink.c
+++ b/net/netlink/genetlink.c
@@ -317,7 +317,7 @@ static void genl_unregister_mc_groups(struct genl_family *family)
317 } 317 }
318} 318}
319 319
320static int genl_validate_ops(struct genl_family *family) 320static int genl_validate_ops(const struct genl_family *family)
321{ 321{
322 const struct genl_ops *ops = family->ops; 322 const struct genl_ops *ops = family->ops;
323 unsigned int n_ops = family->n_ops; 323 unsigned int n_ops = family->n_ops;
@@ -337,10 +337,6 @@ static int genl_validate_ops(struct genl_family *family)
337 return -EINVAL; 337 return -EINVAL;
338 } 338 }
339 339
340 /* family is not registered yet, so no locking needed */
341 family->ops = ops;
342 family->n_ops = n_ops;
343
344 return 0; 340 return 0;
345} 341}
346 342