mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04: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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
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…
Reference in a new issue