]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
netlink: do not store start function in netlink_cb
authorFlorian Westphal <fw@strlen.de>
Tue, 24 Jul 2018 10:47:56 +0000 (12:47 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Jul 2018 17:04:49 +0000 (10:04 -0700)
->start() is called once when dump is being initialized, there is no
need to store it in netlink_cb.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/netlink.h
net/netlink/af_netlink.c

index f3075d6c7e8229c999ab650537f1e3b11e1f457b..71f121b66ca896a455d4ebf310c94d4a0472eaff 100644 (file)
@@ -170,7 +170,6 @@ netlink_skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
 struct netlink_callback {
        struct sk_buff          *skb;
        const struct nlmsghdr   *nlh;
-       int                     (*start)(struct netlink_callback *);
        int                     (*dump)(struct sk_buff * skb,
                                        struct netlink_callback *cb);
        int                     (*done)(struct netlink_callback *cb);
index 393573a99a5a34d3ebaad3a71b36293b6c2fb19f..f6ac7693d2ccfa7d871afebcd468c0b5fd44d569 100644 (file)
@@ -2300,7 +2300,6 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
 
        cb = &nlk->cb;
        memset(cb, 0, sizeof(*cb));
-       cb->start = control->start;
        cb->dump = control->dump;
        cb->done = control->done;
        cb->nlh = nlh;
@@ -2309,8 +2308,8 @@ int __netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
        cb->min_dump_alloc = control->min_dump_alloc;
        cb->skb = skb;
 
-       if (cb->start) {
-               ret = cb->start(cb);
+       if (control->start) {
+               ret = control->start(cb);
                if (ret)
                        goto error_put;
        }