mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile
@ 2022-02-03 20:17 Martin Kaiser
  2022-02-03 20:17 ` [PATCH 1/2] staging: r8188eu: remove unnecessary error check Martin Kaiser
  2022-02-03 20:17 ` [PATCH 2/2] staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFile Martin Kaiser
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Kaiser @ 2022-02-03 20:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Two simple patches to clean up the error handling of
phy_BB8188E_Config_ParaFile.

Martin Kaiser (2):
  staging: r8188eu: remove unnecessary error check
  staging: r8188eu: simplify error handling in
    phy_BB8188E_Config_ParaFile

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

-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] staging: r8188eu: remove unnecessary error check
  2022-02-03 20:17 [PATCH 0/2] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile Martin Kaiser
@ 2022-02-03 20:17 ` Martin Kaiser
  2022-02-03 20:17 ` [PATCH 2/2] staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFile Martin Kaiser
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Kaiser @ 2022-02-03 20:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

Remove an unnecessary error check in phy_BB8188E_Config_ParaFile.
There's no need to goto phy_BB8190_Config_ParaFile_Fail, this label
is in the following line.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index 41a0d7f0d29f..accbd08d4fd1 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -508,9 +508,6 @@ static	int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
 	if (HAL_STATUS_FAILURE == ODM_ReadAndConfig_AGC_TAB_1T_8188E(&pHalData->odmpriv))
 		rtStatus = _FAIL;
 
-	if (rtStatus != _SUCCESS)
-		goto phy_BB8190_Config_ParaFile_Fail;
-
 phy_BB8190_Config_ParaFile_Fail:
 
 	return rtStatus;
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFile
  2022-02-03 20:17 [PATCH 0/2] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile Martin Kaiser
  2022-02-03 20:17 ` [PATCH 1/2] staging: r8188eu: remove unnecessary error check Martin Kaiser
@ 2022-02-03 20:17 ` Martin Kaiser
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Kaiser @ 2022-02-03 20:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

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>
---
 drivers/staging/r8188eu/hal/rtl8188e_phycfg.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
index accbd08d4fd1..8279768201b7 100644
--- a/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
+++ b/drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
@@ -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
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-03 20:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-03 20:17 [PATCH 0/2] staging: r8188eu: clean up phy_BB8188E_Config_ParaFile Martin Kaiser
2022-02-03 20:17 ` [PATCH 1/2] staging: r8188eu: remove unnecessary error check Martin Kaiser
2022-02-03 20:17 ` [PATCH 2/2] staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFile Martin Kaiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®