From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Christian Brauner <brauner@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH net-next][resend v1 2/2] netlink: Make use of __assign_bit() API
Date: Mon, 10 Jul 2023 13:08:30 +0300 [thread overview]
Message-ID: <20230710100830.89936-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20230710100830.89936-1-andriy.shevchenko@linux.intel.com>
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>
---
net/netlink/af_netlink.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index d81e7a43944c..81e4b802f3f9 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1630,10 +1630,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);
}
--
2.40.0.1.gaa8946217a0b
next prev parent reply other threads:[~2023-07-10 10:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-10 10:08 [PATCH net-next][resend v1 1/2] net/core: Make use of assign_bit() API Andy Shevchenko
2023-07-10 10:08 ` Andy Shevchenko [this message]
2023-07-10 14:05 ` [PATCH net-next][resend v1 2/2] netlink: Make use of __assign_bit() API Alexander Lobakin
2023-07-10 14:05 ` [PATCH net-next][resend v1 1/2] net/core: Make use of assign_bit() API Alexander Lobakin
2023-07-11 11:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230710100830.89936-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=brauner@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox