Re: [PATCH 2/4] staging: r8188eu: convert return type of Hal_GetChnlGroup88E() to void

From: Phillip Potter
Date: Sat Aug 14 2021 - 13:12:56 EST


On Fri, 13 Aug 2021 at 08:32, Michael Straube <straube.linux@xxxxxxxxx> wrote:
>
> 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.
>
> Signed-off-by: Michael Straube <straube.linux@xxxxxxxxx>
> ---
> .../staging/r8188eu/hal/rtl8188e_hal_init.c | 30 ++++++++-----------
> 1 file changed, 13 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> index 634a0a022727..d3345fa0eb60 100644
> --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
> @@ -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];
> --
> 2.32.0
>

Dear Michael,

Looks good to me, thanks.

Acked-by: Phillip Potter <phil@xxxxxxxxxxxxxxxx>

Regards,
Phil