mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 14:41:27 +00:00
[NETLINK]: Make netlink_callback->done() optional
Most netlink families make no use of the done() callback, making it optional gets rid of all unnecessary dummy implementations. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
bfa83a9e03
commit
a8f74b2288
5 changed files with 8 additions and 25 deletions
|
@ -427,7 +427,8 @@ static int netlink_release(struct socket *sock)
|
|||
|
||||
spin_lock(&nlk->cb_lock);
|
||||
if (nlk->cb) {
|
||||
nlk->cb->done(nlk->cb);
|
||||
if (nlk->cb->done)
|
||||
nlk->cb->done(nlk->cb);
|
||||
netlink_destroy_callback(nlk->cb);
|
||||
nlk->cb = NULL;
|
||||
}
|
||||
|
@ -1322,7 +1323,8 @@ static int netlink_dump(struct sock *sk)
|
|||
skb_queue_tail(&sk->sk_receive_queue, skb);
|
||||
sk->sk_data_ready(sk, skb->len);
|
||||
|
||||
cb->done(cb);
|
||||
if (cb->done)
|
||||
cb->done(cb);
|
||||
nlk->cb = NULL;
|
||||
spin_unlock(&nlk->cb_lock);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue