Commit 2f91abd4 authored by Denis ChengRq's avatar Denis ChengRq Committed by David S. Miller

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: default avatarCheng Renquan <crquan@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96b2e73c
...@@ -317,7 +317,7 @@ static void genl_unregister_mc_groups(struct genl_family *family) ...@@ -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; const struct genl_ops *ops = family->ops;
unsigned int n_ops = family->n_ops; unsigned int n_ops = family->n_ops;
...@@ -337,10 +337,6 @@ static int genl_validate_ops(struct genl_family *family) ...@@ -337,10 +337,6 @@ static int genl_validate_ops(struct genl_family *family)
return -EINVAL; return -EINVAL;
} }
/* family is not registered yet, so no locking needed */
family->ops = ops;
family->n_ops = n_ops;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment