]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: replace type and rename the chip_type field
authorNikolay Kulikov <nikolayof23@gmail.com>
Sat, 2 May 2026 21:55:41 +0000 (00:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 May 2026 14:53:18 +0000 (16:53 +0200)
The 'chip_type' field always accepts one value from the
hal_chip_type_e enumeration: TEST_CHIP or NORMAL_CHIP (FPGA is never
used).
Changing this field's type to bool will allow it to be used directly in
conditions without the need for wrapped macros.

The new type requires a corresponding variable name, so rename it to
'chip_normal' to improve code readability.

Signed-off-by: Nikolay Kulikov <nikolayof23@gmail.com>
Link: https://patch.msgid.link/20260502220056.59815-3-nikolayof23@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
drivers/staging/rtl8723bs/include/HalVerDef.h

index a4e7bf0e8a97dfe674fbbe276323b740fc422406..87da5f908e1aaa8ceb60e22f0bd5f5e3b9dc0642 100644 (file)
@@ -836,7 +836,7 @@ static struct hal_version ReadChipVersion8723B(struct adapter *padapter)
 
        value32 = rtw_read32(padapter, REG_SYS_CFG);
        ChipVersion.ICType = CHIP_8723B;
-       ChipVersion.chip_type = ((value32 & RTL_ID) ? TEST_CHIP : NORMAL_CHIP);
+       ChipVersion.chip_normal = ((value32 & RTL_ID) ? false : true);
        ChipVersion.VendorType = ((value32 & VENDOR_ID) ? CHIP_VENDOR_UMC : CHIP_VENDOR_TSMC);
        ChipVersion.CUTVersion = (value32 & CHIP_VER_RTL_MASK)>>CHIP_VER_RTL_SHIFT; /*  IC version (CUT) */
 
@@ -912,7 +912,7 @@ void _InitBurstPktLen_8723BS(struct adapter *Adapter)
 
        /*  ARFB table 9 for 11ac 5G 2SS */
        rtw_write32(Adapter, REG_ARFR0_8723B, 0x00000010);
-       if (IS_NORMAL_CHIP(pHalData->VersionID))
+       if (pHalData->VersionID.chip_normal)
                rtw_write32(Adapter, REG_ARFR0_8723B+4, 0xfffff000);
        else
                rtw_write32(Adapter, REG_ARFR0_8723B+4, 0x3e0ff000);
index bf4716ec18e820db7c69411645153cf8bf94f3b2..fbdfb690b73be23c11f4b5d5df626ed1c11dc983 100644 (file)
@@ -43,7 +43,7 @@ enum hal_vendor_e { /* tag_HAL_Manufacturer_Version_Definition */
 
 struct hal_version { /* tag_HAL_VERSION */
        enum hal_ic_type_e              ICType;
-       enum hal_chip_type_e chip_type;
+       bool chip_normal;       /* true - normal chip, false - test chip */
        enum hal_cut_version_e  CUTVersion;
        enum hal_vendor_e               VendorType;
        u8                      ROMVer;