staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void
authorMichael Straube <straube.linux@gmail.com>
Fri, 13 Aug 2021 07:31:07 +0000 (09:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Aug 2021 07:08:11 +0000 (09:08 +0200)
After the removal of 5GHz code from Hal_GetChnlGroup88E() the function
always returns true now. Convert the return type to void and change the
only user Hal_ReadTxPowerInfo88E() accordingly.

Acked-by: Phillip Potter <phil@philpotter.co.uk>
Acked-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20210813073109.25609-3-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c

index 634a0a0..d3345fa 100644 (file)
@@ -2060,7 +2060,7 @@ static void Hal_ReadPowerValueFromPROM_8188E(struct txpowerinfo24g *pwrInfo24G,
        }
 }
 
-static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
+static void Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
 {
        if (chnl < 3)                   /*  Channel 1-2 */
                *pGroup = 0;
@@ -2074,8 +2074,6 @@ static u8 Hal_GetChnlGroup88E(u8 chnl, u8 *pGroup)
                *pGroup = 4;
        else if (chnl == 14)            /*  Channel 14 */
                *pGroup = 5;
-
-       return true;
 }
 
 void Hal_ReadPowerSavingMode88E(struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail)
@@ -2107,7 +2105,7 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
        struct hal_data_8188e   *pHalData = GET_HAL_DATA(padapter);
        struct txpowerinfo24g pwrInfo24G;
        u8 rfPath, ch, group;
-       u8 bIn24G, TxCount;
+       u8 TxCount;
 
        Hal_ReadPowerValueFromPROM_8188E(&pwrInfo24G, PROMContent, AutoLoadFail);
 
@@ -2116,19 +2114,17 @@ void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *PROMContent, bool Auto
 
        for (rfPath = 0; rfPath < pHalData->NumTotalRFPath; rfPath++) {
                for (ch = 0; ch < CHANNEL_MAX_NUMBER; ch++) {
-                       bIn24G = Hal_GetChnlGroup88E(ch, &group);
-                       if (bIn24G) {
-                               pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
-                               if (ch == 14)
-                                       pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
-                               else
-                                       pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
-                       }
-                       if (bIn24G) {
-                               DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
-                               DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
-                               DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
-                       }
+                       Hal_GetChnlGroup88E(ch, &group);
+
+                       pHalData->Index24G_CCK_Base[rfPath][ch] = pwrInfo24G.IndexCCK_Base[rfPath][group];
+                       if (ch == 14)
+                               pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][4];
+                       else
+                               pHalData->Index24G_BW40_Base[rfPath][ch] = pwrInfo24G.IndexBW40_Base[rfPath][group];
+
+                       DBG_88E("======= Path %d, Channel %d =======\n", rfPath, ch);
+                       DBG_88E("Index24G_CCK_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_CCK_Base[rfPath][ch]);
+                       DBG_88E("Index24G_BW40_Base[%d][%d] = 0x%x\n", rfPath, ch, pHalData->Index24G_BW40_Base[rfPath][ch]);
                }
                for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
                        pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];