[PATCH] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile

Martin Kaiser posted 1 patch 4 years, 5 months ago
drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 20 ++++++-------------
1 file changed, 6 insertions(+), 14 deletions(-)
[PATCH] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile
Posted by Martin Kaiser 4 years, 5 months ago
Clean up the code of the phy_BB8188E_Config_ParaFile function.

Replace a TAB with a space in the function definition.

Put the HAL_STATUS_FAILURE on the right-hand side of the comparisons.

Simplify the error handling. Exit directly if we detect an error.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
This should be applied on top of
[PATCH] staging: rt8188eu: Remove dead code.

 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 20 ++++++-------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 41a0d7f0d29f..f1cd220ea20b 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -483,20 +483,17 @@ void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMa
 		pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][13] = Data;
 }
 
-static	int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
+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;
+	if (ODM_ReadAndConfig_PHY_REG_1T_8188E(&pHalData->odmpriv) == HAL_STATUS_FAILURE)
+		return _FAIL;
 
 	/*  2. If EEPROM or EFUSE autoload OK, We must config by PHY_REG_PG.txt */
 	if (!pEEPROM->bautoload_fail_flag) {
@@ -505,15 +502,10 @@ 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;
-
-	if (rtStatus != _SUCCESS)
-		goto phy_BB8190_Config_ParaFile_Fail;
+	if (ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv) == HAL_STATUS_FAILURE)
+		return _FAIL;
 
-phy_BB8190_Config_ParaFile_Fail:
-
-	return rtStatus;
+	return _SUCCESS;
 }
 
 int
-- 
2.30.2

Re: [PATCH] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile
Posted by Greg Kroah-Hartman 4 years, 4 months ago
On Sun, Jan 30, 2022 at 07:22:49PM +0100, Martin Kaiser wrote:
> Clean up the code of the phy_BB8188E_Config_ParaFile function.
> 
> Replace a TAB with a space in the function definition.
> 
> Put the HAL_STATUS_FAILURE on the right-hand side of the comparisons.
> 
> Simplify the error handling. Exit directly if we detect an error.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
> This should be applied on top of
> [PATCH] staging: rt8188eu: Remove dead code.
> 
>  drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 20 ++++++-------------
>  1 file changed, 6 insertions(+), 14 deletions(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- Your patch did many different things all at once, making it difficult
  to review.  All Linux kernel patches need to only do one thing at a
  time.  If you need to do multiple things (such as clean up all coding
  style issues in a file/driver), do it in a sequence of patches, each
  one doing only one thing.  This will make it easier to review the
  patches to ensure that they are correct, and to help alleviate any
  merge issues that larger patches can cause.


If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot