> -----Original Message----- > From: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> > Sent: Wednesday, November 9, 2022 2:58 AM > To: linux-wireless@xxxxxxxxxxxxxxx > Cc: Jes Sorensen <Jes.Sorensen@xxxxxxxxx>; Ping-Ke Shih <pkshih@xxxxxxxxxxx> > Subject: [PATCH 3/3] wifi: rtl8xxxu: Use u32_get_bits in *_identify_chip > > It simplifies the code a bit. > > Suggested-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > Signed-off-by: Bitterblue Smith <rtl8821cerfe2@xxxxxxxxx> Reviewed-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> > --- > This patch should be applied after my older patch: > "[PATCH v2 2/3] wifi: rtl8xxxu: Split up rtl8xxxu_identify_chip" > --- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c | 3 +-- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c | 5 ++--- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 5 ++--- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c | 5 ++--- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c | 5 ++--- > drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h | 1 - > 6 files changed, 9 insertions(+), 15 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > index ef38891ddbd1..2c4f403ba68f 100644 > --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c > @@ -335,8 +335,7 @@ static int rtl8188fu_identify_chip(struct rtl8xxxu_priv *priv) > priv->has_wifi = 1; > > sys_cfg = rtl8xxxu_read32(priv, REG_SYS_CFG); > - priv->chip_cut = (sys_cfg & SYS_CFG_CHIP_VERSION_MASK) >> > - SYS_CFG_CHIP_VERSION_SHIFT; > + priv->chip_cut = u32_get_bits(sys_cfg, SYS_CFG_CHIP_VERSION_MASK); Good to use u32_get_bits() instead of FIELD_GET(). I guess you see Kalle reminded me to use u32_encode_bits(), but I forget to forward this message to you. Anyway, thanks for your works. [...]