From: Ping-Ke Shih <pkshih@realtek.com>
To: Pei Xiao <xiaopei01@kylinos.cn>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags
Date: Tue, 24 Jun 2025 02:28:46 +0000 [thread overview]
Message-ID: <910133af3684449cab0dba7a9389df04@realtek.com> (raw)
In-Reply-To: <530c4d8c788a875690948f0f5029e3091aaab5d4.1750730099.git.xiaopei01@kylinos.cn>
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>
> ---
> 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..37788aca200b 100644
> --- a/drivers/net/wireless/realtek/rtw88/coex.c
> +++ b/drivers/net/wireless/realtek/rtw88/coex.c
> @@ -1500,23 +1500,23 @@ static u8 rtw_coex_algorithm(struct rtw_dev *rtwdev)
> case BPM_HFP:
> algorithm = COEX_ALGO_HFP;
> break;
> - case BPM_HID:
> - case BPM_HFP + BPM_HID:
> + case 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:
Please just replace '+' by '|'. Keep spaces. People can be easier to see the
combination of BT profiles.
> 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:
> --
> 2.25.1
prev parent reply other threads:[~2025-06-24 2:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-24 2:07 [PATCH] wifi: rtw88: coex: Use bitwise instead of arithmetic operator for flags Pei Xiao
2025-06-24 2:28 ` Ping-Ke Shih [this message]
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=910133af3684449cab0dba7a9389df04@realtek.com \
--to=pkshih@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=xiaopei01@kylinos.cn \
/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