* Re: [RESEND PATCH v2 4/6] nfc: llcp: use test_bit()
[not found] <7fc4cb250bb8406cadf80649e366b249@AcuMS.aculab.com>
@ 2022-03-03 13:13 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-03 13:13 UTC (permalink / raw)
To: linux-nfc
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
On 03/03/2022 01:10, David Laight wrote:
> 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).
>
It's not declared as bitmap but it is unsigned long, so an appropriate
type (and same type) for test_bit.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
* [RESEND PATCH v2 4/6] nfc: llcp: use test_bit()
2022-03-02 19:25 [RESEND PATCH v2 0/6] nfc: llcp: few cleanups/improvements Krzysztof Kozlowski
@ 2022-03-02 19:25 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2022-03-02 19:25 UTC (permalink / raw)
To: linux-nfc
[-- Attachment #1: Type: text/plain, Size: 731 bytes --]
Use test_bit() instead of open-coding it, just like in other places
touching the bitmap.
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-03 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <7fc4cb250bb8406cadf80649e366b249@AcuMS.aculab.com>
2022-03-03 13:13 ` [RESEND PATCH v2 4/6] nfc: llcp: use test_bit() Krzysztof Kozlowski
2022-03-02 19:25 [RESEND PATCH v2 0/6] nfc: llcp: few cleanups/improvements Krzysztof Kozlowski
2022-03-02 19:25 ` [RESEND PATCH v2 4/6] nfc: llcp: use test_bit() Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).