From: Michael Straube Date: Sun, 28 Nov 2021 17:09:18 +0000 (+0100) Subject: staging: r8188eu: remove rf_type from getTxPowerIndex88E() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8f18397277308220e7079fadaf71d5d9c72c71c5;p=linux.git staging: r8188eu: remove rf_type from getTxPowerIndex88E() pHalData->rf_type is always RF_1T1R. As a result the variable path_nums is always set to 1 and the for loop is entered only once with TxCount = 0. Also RF_PATH_A = 0. Remove the unneeded check for pHalData->rf_type and resulting dead code from getTxPowerIndex88E(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c index 258349e6104ff..7124b9880efab 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c @@ -611,74 +611,18 @@ static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPower { struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter); u8 index = (channel - 1); - u8 TxCount = 0, path_nums; - - if ((RF_1T2R == pHalData->rf_type) || (RF_1T1R == pHalData->rf_type)) - path_nums = 1; - else - path_nums = 2; - - for (TxCount = 0; TxCount < path_nums; TxCount++) { - if (TxCount == RF_PATH_A) { - /* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; - /* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->OFDM_24G_Diff[TxCount][RF_PATH_A]; - /* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[TxCount][RF_PATH_A]; - /* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; - } else if (TxCount == RF_PATH_B) { - /* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; - /* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[TxCount][index]; - /* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[TxCount][RF_PATH_A] + - pHalData->BW20_24G_Diff[TxCount][index]; - /* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; - } else if (TxCount == RF_PATH_C) { - /* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; - /* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_B][index] + - pHalData->BW20_24G_Diff[TxCount][index]; - /* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_B][index] + - pHalData->BW20_24G_Diff[TxCount][index]; - /* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; - } else if (TxCount == RF_PATH_D) { - /* 1. CCK */ - cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; - /* 2. OFDM */ - ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_B][index] + - pHalData->BW20_24G_Diff[RF_PATH_C][index] + - pHalData->BW20_24G_Diff[TxCount][index]; - - /* 1. BW20 */ - BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_A][index] + - pHalData->BW20_24G_Diff[RF_PATH_B][index] + - pHalData->BW20_24G_Diff[RF_PATH_C][index] + - pHalData->BW20_24G_Diff[TxCount][index]; - - /* 2. BW40 */ - BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; - } - } + u8 TxCount = RF_PATH_A; + + /* 1. CCK */ + cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; + /* 2. OFDM */ + ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + + pHalData->OFDM_24G_Diff[TxCount][RF_PATH_A]; + /* 1. BW20 */ + BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] + + pHalData->BW20_24G_Diff[TxCount][RF_PATH_A]; + /* 2. BW40 */ + BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index]; } static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,