genetlink: remove superfluous assignment
authorDenis ChengRq <crquan@gmail.com>
Mon, 2 Jun 2014 08:18:01 +0000 (01:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Jun 2014 17:36:18 +0000 (10:36 -0700)
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>
net/netlink/genetlink.c

index a3ba3ca..76393f2 100644 (file)
@@ -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;
 }