Skip to content

Commit

Permalink
genetlink: remove superfluous assignment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis ChengRq authored and David S. Miller committed Jun 2, 2014
1 parent 96b2e73 commit 2f91abd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/netlink/genetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 2f91abd

Please sign in to comment.