From: Andy Shevchenko Date: Mon, 10 Jul 2023 10:08:30 +0000 (+0300) Subject: netlink: Make use of __assign_bit() API X-Git-Tag: v6.6.7~2079^2~414 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8e39b38487e68c6503419db6e4a851a0ef56de7;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Alexander Lobakin Message-ID: <20230710100830.89936-2-andriy.shevchenko@linux.intel.com> Signed-off-by: Paolo Abeni --- diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 3836318..9c9df14 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); }