diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-07-10 12:08:30 +0200 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-07-11 12:23:15 +0200 |
commit | b8e39b38487e68c6503419db6e4a851a0ef56de7 (patch) | |
tree | 3c8f34bf76f3144b698792b0a85b7044eb676557 /net/netlink | |
parent | net/core: Make use of assign_bit() API (diff) | |
download | linux-b8e39b38487e68c6503419db6e4a851a0ef56de7.tar.xz linux-b8e39b38487e68c6503419db6e4a851a0ef56de7.zip |
netlink: Make use of __assign_bit() API
We have for some time the __assign_bit() API to replace open coded
if (foo)
__set_bit(n, bar);
else
__clear_bit(n, bar);
Use this API in the code. No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Message-ID: <20230710100830.89936-2-andriy.shevchenko@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/af_netlink.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 383631873748..9c9df143a2ec 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1629,10 +1629,7 @@ static void netlink_update_socket_mc(struct netlink_sock *nlk, old = test_bit(group - 1, nlk->groups); subscriptions = nlk->subscriptions - old + new; - if (new) - __set_bit(group - 1, nlk->groups); - else - __clear_bit(group - 1, nlk->groups); + __assign_bit(group - 1, nlk->groups, new); netlink_update_subscriptions(&nlk->sk, subscriptions); netlink_update_listeners(&nlk->sk); } |