From: David Laight <David.Laight@ACULAB.COM>
To: 'Krzysztof Kozlowski' <krzysztof.kozlowski@canonical.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"linux-nfc@lists.01.org" <linux-nfc@lists.01.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [RESEND PATCH v2 4/6] nfc: llcp: use test_bit()
Date: Thu, 3 Mar 2022 00:10:36 +0000 [thread overview]
Message-ID: <7fc4cb250bb8406cadf80649e366b249@AcuMS.aculab.com> (raw)
In-Reply-To: <20220302192523.57444-5-krzysztof.kozlowski@canonical.com>
From: Krzysztof Kozlowski
> Sent: 02 March 2022 19:25
>
> Use test_bit() instead of open-coding it, just like in other places
> touching the bitmap.
Except it isn't a bitmap, it is just a structure member that contains bits.
So all the other places should be changes to use C shifts and masks (etc).
David
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> ---
> net/nfc/llcp_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/nfc/llcp_core.c b/net/nfc/llcp_core.c
> index 5ad5157aa9c5..b70d5042bf74 100644
> --- a/net/nfc/llcp_core.c
> +++ b/net/nfc/llcp_core.c
> @@ -383,7 +383,7 @@ u8 nfc_llcp_get_sdp_ssap(struct nfc_llcp_local *local,
> pr_debug("WKS %d\n", ssap);
>
> /* This is a WKS, let's check if it's free */
> - if (local->local_wks & BIT(ssap)) {
> + if (test_bit(ssap, &local->local_wks)) {
> mutex_unlock(&local->sdp_lock);
>
> return LLCP_SAP_MAX;
> --
> 2.32.0
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2022-03-03 0:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-02 19:25 [linux-nfc] [RESEND PATCH v2 0/6] nfc: llcp: few cleanups/improvements Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 1/6] nfc: llcp: nullify llcp_sock->dev on connect() error paths Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 2/6] nfc: llcp: simplify llcp_sock_connect() " Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 3/6] nfc: llcp: use centralized exiting of bind on errors Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 4/6] nfc: llcp: use test_bit() Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-03 0:10 ` David Laight [this message]
2022-03-03 13:13 ` [linux-nfc] " Krzysztof Kozlowski
2022-03-03 13:13 ` Krzysztof Kozlowski
2022-03-03 13:13 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 5/6] nfc: llcp: protect nfc_llcp_sock_unlink() calls Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` [linux-nfc] [RESEND PATCH v2 6/6] nfc: llcp: Revert "NFC: Keep socket alive until the DISC PDU is actually sent" Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-02 19:25 ` Krzysztof Kozlowski
2022-03-03 11:30 ` [RESEND PATCH v2 0/6] nfc: llcp: few cleanups/improvements 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=7fc4cb250bb8406cadf80649e366b249@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=davem@davemloft.net \
--cc=krzysztof.kozlowski@canonical.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfc@lists.01.org \
--cc=netdev@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.