From 2f91abd4516da0cadfb955c963b16f96e2e6c07a Mon Sep 17 00:00:00 2001 From: Denis ChengRq Date: Mon, 2 Jun 2014 01:18:01 -0700 Subject: 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 Signed-off-by: David S. Miller --- net/netlink/genetlink.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'net/netlink') 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) } } -static int genl_validate_ops(struct genl_family *family) +static int genl_validate_ops(const struct genl_family *family) { const struct genl_ops *ops = family->ops; unsigned int n_ops = family->n_ops; @@ -337,10 +337,6 @@ static int genl_validate_ops(struct genl_family *family) return -EINVAL; } - /* family is not registered yet, so no locking needed */ - family->ops = ops; - family->n_ops = n_ops; - return 0; } -- cgit v1.2.3-58-ga151