From: Ping-Ke Shih <pkshih@realtek.com>
To: Bitterblue Smith <rtl8821cerfe2@gmail.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: Jes Sorensen <Jes.Sorensen@gmail.com>
Subject: RE: [PATCH 2/2] wifi: rtl8xxxu: Fix assignment to bit field priv->cck_agc_report_type
Date: Fri, 9 Dec 2022 08:15:39 +0000 [thread overview]
Message-ID: <620a128bf71b4161b85ee6e9a8d7761c@realtek.com> (raw)
In-Reply-To: <7bb4858c-5cef-9cae-5e08-7e8444e8ba89@gmail.com>
> -----Original Message-----
> From: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> Sent: Friday, December 9, 2022 3:34 AM
> To: linux-wireless@vger.kernel.org
> Cc: Jes Sorensen <Jes.Sorensen@gmail.com>; Ping-Ke Shih <pkshih@realtek.com>
> Subject: [PATCH 2/2] wifi: rtl8xxxu: Fix assignment to bit field priv->cck_agc_report_type
>
> Just because priv->cck_agc_report_type is only one bit doesn't mean
> it works like a bool. The value assigned to it loses all bits except
> bit 0, so only assign 0 or 1 to it.
>
> This affects the RTL8192EU, but rtl8xxxu already can't connect to any
> networks with this chip, so it probably didn't bother anyone.
>
> Fixes: 2ad2a813b803 ("wifi: rtl8xxxu: Fix the CCK RSSI calculation")
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> index 3ed435401e57..799b03ec1980 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
> @@ -4208,10 +4208,12 @@ static int rtl8xxxu_init_device(struct ieee80211_hw *hw)
> * should be equal or CCK RSSI report may be incorrect
> */
> val32 = rtl8xxxu_read32(priv, REG_FPGA0_XA_HSSI_PARM2);
> - priv->cck_agc_report_type = val32 & FPGA0_HSSI_PARM2_CCK_HIGH_PWR;
> + priv->cck_agc_report_type =
> + u32_get_bits(val32, FPGA0_HSSI_PARM2_CCK_HIGH_PWR);
>
> val32 = rtl8xxxu_read32(priv, REG_FPGA0_XB_HSSI_PARM2);
> - if (priv->cck_agc_report_type != (bool)(val32 & FPGA0_HSSI_PARM2_CCK_HIGH_PWR)) {
> + if (priv->cck_agc_report_type !=
> + u32_get_bits(val32, FPGA0_HSSI_PARM2_CCK_HIGH_PWR)) {
> if (priv->cck_agc_report_type)
> val32 |= FPGA0_HSSI_PARM2_CCK_HIGH_PWR;
> else
> --
> 2.38.0
>
> ------Please consider the environment before printing this e-mail.
next prev parent reply other threads:[~2022-12-09 8:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 19:32 [PATCH 1/2] wifi: rtl8xxxu: Fix assignment to bit field priv->pi_enabled Bitterblue Smith
2022-12-08 19:34 ` [PATCH 2/2] wifi: rtl8xxxu: Fix assignment to bit field priv->cck_agc_report_type Bitterblue Smith
2022-12-09 8:15 ` Ping-Ke Shih [this message]
2022-12-09 8:14 ` [PATCH 1/2] wifi: rtl8xxxu: Fix assignment to bit field priv->pi_enabled Ping-Ke Shih
2022-12-14 12:23 ` Kalle Valo
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=620a128bf71b4161b85ee6e9a8d7761c@realtek.com \
--to=pkshih@realtek.com \
--cc=Jes.Sorensen@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=rtl8821cerfe2@gmail.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;
as well as URLs for NNTP newsgroup(s).