wifi: rtl8xxxu: Fix assignment to bit field priv->pi_enabled
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Thu, 8 Dec 2022 19:32:18 +0000 (21:32 +0200)
committerKalle Valo <kvalo@kernel.org>
Wed, 14 Dec 2022 12:22:49 +0000 (14:22 +0200)
Just because priv->pi_enabled 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 RTL8188FU, but fixing the assignment didn't make
a difference for my device.

Fixes: c888183b21f3 ("wifi: rtl8xxxu: Support new chip RTL8188FU")
Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/4368d585-11ec-d3c7-ec12-7f0afdcedfda@gmail.com
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c

index 2c4f403..97e7ff7 100644 (file)
@@ -1122,7 +1122,7 @@ static void rtl8188fu_phy_iqcalibrate(struct rtl8xxxu_priv *priv,
 
        if (t == 0) {
                val32 = rtl8xxxu_read32(priv, REG_FPGA0_XA_HSSI_PARM1);
-               priv->pi_enabled = val32 & FPGA0_HSSI_PARM1_PI;
+               priv->pi_enabled = u32_get_bits(val32, FPGA0_HSSI_PARM1_PI);
        }
 
        /* save RF path */