]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: rtl8723bs: move constant to right side of test in comparison
authorPrithvi Tambewagh <activprithvi@gmail.com>
Thu, 9 Apr 2026 13:50:22 +0000 (19:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 11:01:54 +0000 (05:01 -0600)
Move constant from the left side to the right side of the test in a
comparison, where ==, !=, <=, >=, <, > operators are used, fixing the
checkpatch warning: Comparisons should place the constant on the right
side of the test.

Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
Reviewed-by: Luka Gejak <luka.gejak@linux.dev>
Link: https://patch.msgid.link/20260409135026.137904-2-activprithvi@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
drivers/staging/rtl8723bs/hal/HalPhyRf_8723B.c
drivers/staging/rtl8723bs/hal/hal_com.c
drivers/staging/rtl8723bs/hal/hal_com_phycfg.c
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
drivers/staging/rtl8723bs/include/ieee80211.h

index d32dbf94858faf9650b4663392f045fb342ee376..58f6cf063498ad909e1f7e064fcfd33395e1bdc5 100644 (file)
@@ -2211,7 +2211,7 @@ static void halbtc8723b2ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
        }
 
        algorithm = halbtc8723b2ant_ActionAlgorithm(pBtCoexist);
-       if (pCoexSta->bC2hBtInquiryPage && (BT_8723B_2ANT_COEX_ALGO_PANHS != algorithm)) {
+       if (pCoexSta->bC2hBtInquiryPage && (algorithm != BT_8723B_2ANT_COEX_ALGO_PANHS)) {
                halbtc8723b2ant_ActionBtInquiry(pBtCoexist);
                return;
        } else {
@@ -2490,7 +2490,7 @@ void EXhalbtc8723b2ant_BtInfoNotify(
                return;
        }
 
-       if (BT_INFO_SRC_8723B_2ANT_WIFI_FW != rspSource) {
+       if (rspSource != BT_INFO_SRC_8723B_2ANT_WIFI_FW) {
                pCoexSta->btRetryCnt = pCoexSta->btInfoC2h[rspSource][2] & 0xf; /* [3:0] */
 
                pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 + 10;
index 8f6849f2277e175891d6f36a26933edc01453657..0780847e287dd79f6aa739e9ac927e20de9b22df 100644 (file)
@@ -301,7 +301,7 @@ static void GetDeltaSwingTable_8723B(
        u16 rate = *(pDM_Odm->pForcedDataRate);
        u8 channel = pHalData->CurrentChannel;
 
-       if (1 <= channel && channel <= 14) {
+       if (channel >= 1 && channel <= 14) {
                if (IS_CCK_RATE(rate)) {
                        *TemperatureUP_A   = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P;
                        *TemperatureDOWN_A = pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N;
index 4e3cd1547e010e01cf1bbc04782a0baa544187ea..b99dee6a7ed37b5b4569c66cc53b7c5a82c56137 100644 (file)
@@ -107,7 +107,7 @@ u8 hal_com_config_channel_plan(
        pHalData->bDisableSWChannelPlan = false;
        chnlPlan = def_channel_plan;
 
-       if (0xFF == hw_channel_plan)
+       if (hw_channel_plan == 0xFF)
                auto_load_fail = true;
 
        if (!auto_load_fail) {
index bdd595a99b98097203c98b6fd2bddb1ce8eebd86..2746da0a9846fdba1c0300dc69da0b26cc47e65a 100644 (file)
@@ -466,11 +466,11 @@ u8 PHY_GetTxPowerIndexBase(
 
        if (IS_CCK_RATE(Rate))
                txPower = pHalData->Index24G_CCK_Base[RFPath][chnlIdx];
-       else if (MGN_6M <= Rate)
+       else if (Rate >= MGN_6M)
                txPower = pHalData->Index24G_BW40_Base[RFPath][chnlIdx];
 
        /*  OFDM-1T */
-       if ((MGN_6M <= Rate && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
+       if ((Rate >= MGN_6M && Rate <= MGN_54M) && !IS_CCK_RATE(Rate))
                txPower += pHalData->OFDM_24G_Diff[RFPath][TX_1S];
 
        if (BandWidth == CHANNEL_WIDTH_20) { /*  BW20-1S, BW20-2S */
index 3dff8aa2badbabe6943e5ca6394a19478c4e0030..f20f0a60fec135082fc0236d8274b52e2a9059d5 100644 (file)
@@ -405,11 +405,11 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool  bUsedWoWLANFw)
                        break;
        }
        _FWDownloadEnable(padapter, false);
-       if (_SUCCESS != rtStatus)
+       if (rtStatus != _SUCCESS)
                goto fwdl_stat;
 
        rtStatus = _FWFreeToGo(padapter, 10, 200);
-       if (_SUCCESS != rtStatus)
+       if (rtStatus != _SUCCESS)
                goto fwdl_stat;
 
 fwdl_stat:
@@ -1169,15 +1169,15 @@ s32 rtl8723b_InitLLTTable(struct adapter *padapter)
 
 static void hal_get_chnl_group_8723b(u8 channel, u8 *group)
 {
-       if (1  <= channel && channel <= 2)
+       if (channel >= 1 && channel <= 2)
                *group = 0;
-       else if (3  <= channel && channel <= 5)
+       else if (channel >= 3 && channel <= 5)
                *group = 1;
-       else if (6  <= channel && channel <= 8)
+       else if (channel >= 6 && channel <= 8)
                *group = 2;
-       else if (9  <= channel && channel <= 11)
+       else if (channel >= 9 && channel <= 11)
                *group = 3;
-       else if (12 <= channel && channel <= 14)
+       else if (channel >= 12 && channel <= 14)
                *group = 4;
 }
 
@@ -1225,7 +1225,7 @@ static void Hal_ReadPowerValueFromPROM_8723B(
 
        memset(pwrInfo24G, 0, sizeof(struct TxPowerInfo24G));
 
-       if (0xFF == PROMContent[eeAddr+1])
+       if (PROMContent[eeAddr+1] == 0xFF)
                AutoLoadFail = true;
 
        if (AutoLoadFail) {
@@ -2042,7 +2042,7 @@ static void hw_var_set_bcn_func(struct adapter *padapter, u8 variable, u8 *val)
                val8 &= ~(EN_BCN_FUNCTION | EN_TXBCN_RPT);
 
                /*  Always enable port0 beacon function for PSTDMA */
-               if (REG_BCN_CTRL == bcn_ctrl_reg)
+               if (bcn_ctrl_reg == REG_BCN_CTRL)
                        val8 |= EN_BCN_FUNCTION;
 
                rtw_write8(padapter, bcn_ctrl_reg, val8);
index f50726d2ed0c9178ad2c6bce4e7d4c4018ae4abf..ff39077deb698c975d50981dc6f0a2fc83074e26 100644 (file)
@@ -415,7 +415,7 @@ int rtl8723bs_xmit_thread(void *context)
                if (signal_pending(current)) {
                        flush_signals(current);
                }
-       } while (_SUCCESS == ret);
+       } while (ret == _SUCCESS);
 
        complete(&pxmitpriv->SdioXmitTerminate);
 
index fbb12fe31a6c26e97cecb6fac5d549d9fc38f547..a3f519e2f6d2202bc1206bee19b02b3b840f6685 100644 (file)
@@ -394,8 +394,8 @@ enum {
 };
 
 #define IS_HT_RATE(_rate)                              (_rate >= MGN_MCS0 && _rate <= MGN_MCS31)
-#define IS_CCK_RATE(_rate)                             (MGN_1M == _rate || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
-#define IS_OFDM_RATE(_rate)                            (MGN_6M <= _rate && _rate <= MGN_54M  && _rate != MGN_11M)
+#define IS_CCK_RATE(_rate)                             (_rate == MGN_1M || _rate == MGN_2M || _rate == MGN_5_5M || _rate == MGN_11M)
+#define IS_OFDM_RATE(_rate)                            (_rate >= MGN_6M && _rate <= MGN_54M  && _rate != MGN_11M)
 
 
 /* NOTE: This data is for statistical purposes; not all hardware provides this