* [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags
@ 2025-06-24 2:52 Pei Xiao
2025-06-24 3:07 ` Ping-Ke Shih
2025-07-04 2:19 ` Ping-Ke Shih
0 siblings, 2 replies; 3+ messages in thread
From: Pei Xiao @ 2025-06-24 2:52 UTC (permalink / raw)
To: pkshih, linux-wireless, linux-kernel; +Cc: Pei Xiao
This silences the following coccinelle warning:
WARNING: sum of probable bitmasks, consider |
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
---
v2: just replace '+' by '|'. Keep spaces.
---
drivers/net/wireless/realtek/rtw88/coex.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw88/coex.c b/drivers/net/wireless/realtek/rtw88/coex.c
index 64904278ddad..b4dc6ff2c175 100644
--- a/drivers/net/wireless/realtek/rtw88/coex.c
+++ b/drivers/net/wireless/realtek/rtw88/coex.c
@@ -1501,28 +1501,28 @@ static u8 rtw_coex_algorithm(struct rtw_dev *rtwdev)
algorithm = COEX_ALGO_HFP;
break;
case BPM_HID:
- case BPM_HFP + BPM_HID:
+ case BPM_HFP | BPM_HID:
algorithm = COEX_ALGO_HID;
break;
- case BPM_HFP + BPM_A2DP:
- case BPM_HID + BPM_A2DP:
- case BPM_HFP + BPM_HID + BPM_A2DP:
+ case BPM_HFP | BPM_A2DP:
+ case BPM_HID | BPM_A2DP:
+ case BPM_HFP | BPM_HID | BPM_A2DP:
algorithm = COEX_ALGO_A2DP_HID;
break;
- case BPM_HFP + BPM_PAN:
- case BPM_HID + BPM_PAN:
- case BPM_HFP + BPM_HID + BPM_PAN:
+ case BPM_HFP | BPM_PAN:
+ case BPM_HID | BPM_PAN:
+ case BPM_HFP | BPM_HID | BPM_PAN:
algorithm = COEX_ALGO_PAN_HID;
break;
- case BPM_HFP + BPM_A2DP + BPM_PAN:
- case BPM_HID + BPM_A2DP + BPM_PAN:
- case BPM_HFP + BPM_HID + BPM_A2DP + BPM_PAN:
+ case BPM_HFP | BPM_A2DP | BPM_PAN:
+ case BPM_HID | BPM_A2DP | BPM_PAN:
+ case BPM_HFP | BPM_HID | BPM_A2DP | BPM_PAN:
algorithm = COEX_ALGO_A2DP_PAN_HID;
break;
case BPM_PAN:
algorithm = COEX_ALGO_PAN;
break;
- case BPM_A2DP + BPM_PAN:
+ case BPM_A2DP | BPM_PAN:
algorithm = COEX_ALGO_A2DP_PAN;
break;
case BPM_A2DP:
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags
2025-06-24 2:52 [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags Pei Xiao
@ 2025-06-24 3:07 ` Ping-Ke Shih
2025-07-04 2:19 ` Ping-Ke Shih
1 sibling, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2025-06-24 3:07 UTC (permalink / raw)
To: Pei Xiao, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Pei Xiao <xiaopei01@kylinos.cn> wrote:
> This silences the following coccinelle warning:
> WARNING: sum of probable bitmasks, consider |
I will add "Compile tested only" during committing.
>
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags
2025-06-24 2:52 [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags Pei Xiao
2025-06-24 3:07 ` Ping-Ke Shih
@ 2025-07-04 2:19 ` Ping-Ke Shih
1 sibling, 0 replies; 3+ messages in thread
From: Ping-Ke Shih @ 2025-07-04 2:19 UTC (permalink / raw)
To: Pei Xiao, pkshih, linux-wireless, linux-kernel; +Cc: Pei Xiao
Pei Xiao <xiaopei01@kylinos.cn> wrote:
> This silences the following coccinelle warning:
> WARNING: sum of probable bitmasks, consider |
>
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>
1 patch(es) applied to rtw-next branch of rtw.git, thanks.
34d9a2aa7f50 wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags
---
https://github.com/pkshih/rtw.git
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-04 2:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 2:52 [PATCH v2] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags Pei Xiao
2025-06-24 3:07 ` Ping-Ke Shih
2025-07-04 2:19 ` Ping-Ke Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox