staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFile
authorMartin Kaiser <martin@kaiser.cx>
Thu, 3 Feb 2022 20:17:45 +0000 (21:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Feb 2022 14:25:14 +0000 (15:25 +0100)
Simplify error handling in phy_BB8188E_Config_ParaFile. Exit immediately
when there's an error, do not jump to the end of the function. We do not
have anything to clean up before we return.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220203201745.251826-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c

index accbd08d4fd11db8b792dec1c3ffe8c2e1e3cf16..8279768201b7bd4d351986142be6428d8b086565 100644 (file)
@@ -487,16 +487,13 @@ static    int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
 {
        struct eeprom_priv *pEEPROM = &Adapter->eeprompriv;
        struct hal_data_8188e *pHalData = &Adapter->haldata;
-       int                     rtStatus = _SUCCESS;
 
        /*  */
        /*  1. Read PHY_REG.TXT BB INIT!! */
        /*  We will separate as 88C / 92C according to chip version */
        /*  */
        if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv))
-               rtStatus = _FAIL;
-       if (rtStatus != _SUCCESS)
-               goto phy_BB8190_Config_ParaFile_Fail;
+               return _FAIL;
 
        /*  2. If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */
        if (!pEEPROM->bautoload_fail_flag) {
@@ -506,11 +503,9 @@ static     int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
 
        /*  3. BB AGC table Initialization */
        if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv))
-               rtStatus = _FAIL;
+               return _FAIL;
 
-phy_BB8190_Config_ParaFile_Fail:
-
-       return rtStatus;
+       return _SUCCESS;
 }
 
 int