Skip to contentSkip to conversation

staging: rtl8732: Various checkpatch fixes

PATCH In review Justin Vreeland 2 participants 14 messages May 2, 2017 – May 6, 2017 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: rtl8732: Various checkpatch fixes

v2:
Added commit messages
Fixed overly long lines
Added Bastien Nocera's Reviewed-by tag
- Also fixed commit messages marked reviewed, hope that's OK. The patch contents are identical.

Justin Vreeland (7):
staging: rtl8723bs: Fix initialization of static variables
staging: rtl8723bs: Wrap multi-line macros in do-while loop
staging: rtl8723bs: Macros with complex values should be enclosed in
parentheses
staging: rtl8723bs: Move braces to same line as conditional
staging: rtl8723bs: Fix pointer style
staging: rtl8723bs: Fix spacing around '<'
staging: rtl8723bs: Do not use assignment in if condition

 drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c |  8 +--
 drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c |  4 +-
 drivers/staging/rtl8723bs/hal/hal_btcoex.c      |  2 +-
 drivers/staging/rtl8723bs/hal/odm.h             |  5 +-
 drivers/staging/rtl8723bs/hal/odm_DIG.c         |  2 +-
 drivers/staging/rtl8723bs/hal/odm_debug.h       | 81 ++++++++++++++-----------
 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 18 +++---
 drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 12 ++--
 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c  | 20 +++---
 9 files changed, 81 insertions(+), 71 deletions(-)
Signature · 1 line
2.12.2
#1 lore raw

PATCH v2 1/7 staging: rtl8723bs: Fix initialization of static variables

Do not initialize static to 0
Do not initialize static to false

---
 drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 8 ++++----
 drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 4 ++--
 drivers/staging/rtl8723bs/hal/hal_btcoex.c      | 2 +-
 drivers/staging/rtl8723bs/hal/odm_DIG.c         | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +4 -4
index 86040adb436c..37f42bfc55ed 100644
@@ -404,7 +404,7 @@ static void halbtc8723b1ant_MonitorWiFiCtr(PBTC_COEXIST pBtCoexist)
 {
 	s32	wifiRssi = 0;
 	bool bWifiBusy = false, bWifiUnderBMode = false;
-	static u8 nCCKLockCounter = 0;
+	static u8 nCCKLockCounter;
 
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi);
@@ -488,7 +488,7 @@ static void halbtc8723b1ant_MonitorWiFiCtr(PBTC_COEXIST pBtCoexist)
 
 static bool halbtc8723b1ant_IsWifiStatusChanged(PBTC_COEXIST pBtCoexist)
 {
-	static bool	bPreWifiBusy = false, bPreUnder4way = false, bPreBtHsOn = false;
+	static bool	bPreWifiBusy, bPreUnder4way, bPreBtHsOn;
 	bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false;
 	bool bWifiConnected = false;
 
@@ -2754,7 +2754,7 @@ void EXhalbtc8723b1ant_DisplayCoexInfo(PBTC_COEXIST pBtCoexist)
 	u32 wifiBw, wifiTrafficDir, faOfdm, faCck, wifiLinkStatus;
 	u8 wifiDot11Chnl, wifiHsChnl;
 	u32 fwVer = 0, btPatchVer = 0;
-	static u8 PopReportIn10s = 0;
+	static u8 PopReportIn10s;
 
 	CL_SPRINTF(
 		cliBuf,
@@ -3751,7 +3751,7 @@ void EXhalbtc8723b1ant_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState)
 
 void EXhalbtc8723b1ant_Periodical(PBTC_COEXIST pBtCoexist)
 {
-	static u8 disVerInfoCnt = 0;
+	static u8 disVerInfoCnt;
 	u32 fwVer = 0, btPatchVer = 0;
 
 	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n"));
drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +2 -2
index f5bc511d02f2..33610d39333f 100644
@@ -282,7 +282,7 @@ static void halbtc8723b2ant_QueryBtInfo(PBTC_COEXIST pBtCoexist)
 
 static bool halbtc8723b2ant_IsWifiStatusChanged(PBTC_COEXIST pBtCoexist)
 {
-	static bool	bPreWifiBusy = false, bPreUnder4way = false, bPreBtHsOn = false;
+	static bool	bPreWifiBusy, bPreUnder4way, bPreBtHsOn;
 	bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false;
 	bool bWifiConnected = false;
 
@@ -3706,7 +3706,7 @@ void EXhalbtc8723b2ant_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState)
 
 void EXhalbtc8723b2ant_Periodical(PBTC_COEXIST pBtCoexist)
 {
-	static u8 disVerInfoCnt = 0;
+	static u8 disVerInfoCnt;
 	u32 fwVer = 0, btPatchVer = 0;
 
 	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ==========================Periodical ===========================\n"));
drivers/staging/rtl8723bs/hal/hal_btcoex.c +1 -1
index cc7e0903ee9d..9e08a4de4895 100644
@@ -385,7 +385,7 @@ static s32 halbtcoutsrc_GetWifiRssi(struct adapter *padapter)
 static u8 halbtcoutsrc_GetWifiScanAPNum(struct adapter *padapter)
 {
 	struct mlme_ext_priv *pmlmeext;
-	static u8 scan_AP_num = 0;
+	static u8 scan_AP_num;
 
 	pmlmeext = &padapter->mlmeextpriv;
 
drivers/staging/rtl8723bs/hal/odm_DIG.c +1 -1
index ba8e8eb534ef..202c52f488ae 100644
@@ -372,7 +372,7 @@ void odm_PauseDIG(
 {
 	PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
 	pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable;
-	static bool bPaused = false;
+	static bool bPaused;
 
 	ODM_RT_TRACE(pDM_Odm, ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_PauseDIG() =========>\n"));
 
Signature · 1 line
2.12.2
#2 lore raw

PATCH v2 2/7 staging: rtl8723bs: Wrap multi-line macros in do-while loop

In reply to Justin Vreeland

Wrapping in do-while ensures macros are executed as expected.

---
v2:
- Added commit message

 drivers/staging/rtl8723bs/hal/odm_debug.h | 81 +++++++++++++++++--------------
 1 file changed, 45 insertions(+), 36 deletions(-)
drivers/staging/rtl8723bs/hal/odm_debug.h +45 -36
index 2ec4baf57464..ff131361248c 100644
@@ -105,51 +105,60 @@
 
 #if DBG
 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)\
-	if (\
-		(comp & pDM_Odm->DebugComponents) &&\
-		(level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)\
-	) {\
-		RT_PRINTK fmt;\
-	}
+	do {\
+		if (\
+			(comp & pDM_Odm->DebugComponents) &&\
+			(level <= pDM_Odm->DebugLevel ||\
+			 level == ODM_DBG_SERIOUS)\
+		) {\
+			RT_PRINTK fmt;\
+		} \
+	} while (0)
 
 #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)\
-	if (\
-		(comp & pDM_Odm->DebugComponents) &&\
-		(level <= pDM_Odm->DebugLevel)\
-	) {\
-		RT_PRINTK fmt;\
-	}
+	do {\
+		if (\
+			(comp & pDM_Odm->DebugComponents) &&\
+			(level <= pDM_Odm->DebugLevel)\
+		) {\
+			RT_PRINTK fmt;\
+		} \
+	} while (0)
 
 #define ODM_RT_ASSERT(pDM_Odm, expr, fmt)\
-	if (!expr) {\
-		DbgPrint("Assertion failed! %s at ......\n", #expr);\
-		DbgPrint(\
-			"      ......%s,%s, line =%d\n",\
-			__FILE__,\
-			__func__,\
-			__LINE__\
-		);\
-		RT_PRINTK fmt;\
-		ASSERT(false);\
-	}
+	do {\
+		if (!expr) {\
+			DbgPrint("Assertion failed! %s at ......\n", #expr);\
+			DbgPrint(\
+				"      ......%s,%s, line =%d\n",\
+				__FILE__,\
+				__func__,\
+				__LINE__\
+			);\
+			RT_PRINTK fmt;\
+			ASSERT(false);\
+		} \
+	} while (0)
 #define ODM_dbg_enter() { DbgPrint("==> %s\n", __func__); }
 #define ODM_dbg_exit() { DbgPrint("<== %s\n", __func__); }
 #define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __func__, str); }
 
 #define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)\
-	if (\
-		(comp & pDM_Odm->DebugComponents) &&\
-		(level <= pDM_Odm->DebugLevel)\
-	) {\
-		int __i;\
-		u8 *__ptr = (u8 *)ptr;\
-		DbgPrint("[ODM] ");\
-		DbgPrint(title_str);\
-		DbgPrint(" ");\
-		for (__i = 0; __i < 6; __i++)\
-			DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\
-		DbgPrint("\n");\
-	}
+	do {\
+		if (\
+			(comp & pDM_Odm->DebugComponents) &&\
+			(level <= pDM_Odm->DebugLevel)\
+		) {\
+			int __i;\
+			u8 *__ptr = (u8 *)ptr;\
+			DbgPrint("[ODM] ");\
+			DbgPrint(title_str);\
+			DbgPrint(" ");\
+			for (__i = 0; __i < 6; __i++)\
+				DbgPrint("%02X%s", __ptr[__i], (__i == 5) ? "" : "-");\
+			DbgPrint("\n");\
+		} \
+	} while (0)
 #else
 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)		no_printk fmt
 #define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)	no_printk fmt
Signature · 1 line
2.12.2
#3 lore raw

PATCH v2 3/7 staging: rtl8723bs: Macros with complex values should be enclosed in parentheses

In reply to Justin Vreeland

Enclosing macros with complex values ensures expression is evaluated as expected.

---
v2:
- Added spaces around plus signs
- Fixed line over 80 columns
- Added commit message

 drivers/staging/rtl8723bs/hal/odm.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/odm.h +4 -1
index 0b3541a91548..87a76bafecb3 100644
@@ -209,7 +209,10 @@ typedef struct _ODM_RATE_ADAPTIVE {
 
 #define AVG_THERMAL_NUM		8
 #define IQK_Matrix_REG_NUM	8
-#define IQK_Matrix_Settings_NUM	14+24+21 /*  Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G */
+#define IQK_Matrix_Settings_NUM	(14 + 24 + 21) /*   Channels_2_4G_NUM
+						* + Channels_5G_20M_NUM
+						* + Channels_5G
+						*/
 
 #define		DM_Type_ByFW			0
 #define		DM_Type_ByDriver		1
Signature · 1 line
2.12.2
Reviewed-by on v2 3/7
#4 lore raw

Re: [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses

Quoted 29 lines · Justin Vreeland

Enclosing macros with complex values ensures expression is evaluated as
expected.

---
v2:
  - Added spaces around plus signs
  - Fixed line over 80 columns
  - Added commit message

 drivers/staging/rtl8723bs/hal/odm.h | 5 ++++-

 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/odm.h +0 -0
index 0b3541a91548..87a76bafecb3 100644
@@ -209,7 +209,10 @@ typedef struct _ODM_RATE_ADAPTIVE {


 #define AVG_THERMAL_NUM 8
 #define IQK_Matrix_REG_NUM 8
-#define IQK_Matrix_Settings_NUM 14+24+21
/*  Channels_2_4G_NUM + Channels_5G_20M_NUM + Channels_5G */
+#define IQK_Matrix_Settings_NUM (14 + 24 + 21)
/*   Channels_2_4G_NUM

drivers/staging/rtl8723bs/hal/odm.h +1 -0
+						* +

Channels_5G_20M_NUM

drivers/staging/rtl8723bs/hal/odm.h typedef struct _ODM_RATE_ADAPTIVE { · line 215

Quoted 2 lines
drivers/staging/rtl8723bs/hal/odm.h +2 -0
+						* + Channels_5G
+						*/

This does line up when applied, right? If so:

#5 lore raw

PATCH v2 4/7 staging: rtl8723bs: Move braces to same line as conditional

In reply to Justin Vreeland

Ensure checkpatch compliance

---
v2:
- Added commit message
- Fixed overly long lines

 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 18 ++++++++----------
 drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 12 ++++++------
 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c  |  9 ++++-----
 3 files changed, 18 insertions(+), 21 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +8 -10
index 28d1a229c3a6..21ec890fd60c 100644
@@ -385,8 +385,7 @@ s32 PHY_MACConfig8723B(struct adapter *Adapter)
 	/*  Config MAC */
 	/*  */
 	rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile);
-	if (rtStatus == _FAIL)
-	{
+	if (rtStatus == _FAIL) {
 		ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv);
 		rtStatus = _SUCCESS;
 	}
@@ -459,8 +458,7 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
 		Adapter->registrypriv.RegEnableTxPowerLimit == 1 ||
 		(Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1)
 	) {
-		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL)
-		{
+		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) {
 			if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0))
 				rtStatus = _FAIL;
 		}
@@ -474,8 +472,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
 	/*  */
 	/*  1. Read PHY_REG.TXT BB INIT!! */
 	/*  */
-	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) ==
+		_FAIL) {
 		if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))
 			rtStatus = _FAIL;
 	}
@@ -491,8 +489,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
 		Adapter->registrypriv.RegEnableTxPowerByRate == 1 ||
 		(Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2)
 	) {
-		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == _FAIL)
-		{
+		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) ==
+			_FAIL) {
 			if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG))
 				rtStatus = _FAIL;
 		}
@@ -514,8 +512,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
 	/*  */
 	/*  2. Read BB AGC table Initialization */
 	/*  */
-	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, CONFIG_BB_AGC_TAB) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile,
+				     CONFIG_BB_AGC_TAB) == _FAIL) {
 		if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_AGC_TAB))
 			rtStatus = _FAIL;
 	}
drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c +6 -6
index 3a85d0cddfda..a71b552eca9a 100644
@@ -144,15 +144,15 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
 		/*----Initialize RF fom connfiguration file----*/
 		switch (eRFPath) {
 		case RF_PATH_A:
-			if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile, eRFPath) == _FAIL)
-			{
+			if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile,
+						     eRFPath) == _FAIL) {
 				if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
 					rtStatus = _FAIL;
 			}
 			break;
 		case RF_PATH_B:
-			if (PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile, eRFPath) == _FAIL)
-			{
+			if (PHY_ConfigRFWithParaFile(Adapter, pszRadioBFile,
+						     eRFPath) == _FAIL) {
 				if (HAL_STATUS_FAILURE == ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
 					rtStatus = _FAIL;
 			}
@@ -186,8 +186,8 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
 	/* 3 Configuration of Tx Power Tracking */
 	/* 3 ----------------------------------------------------------------- */
 
-	if (PHY_ConfigRFWithTxPwrTrackParaFile(Adapter, pszTxPwrTrackFile) == _FAIL)
-	{
+	if (PHY_ConfigRFWithTxPwrTrackParaFile(Adapter, pszTxPwrTrackFile) ==
+		_FAIL) {
 		ODM_ConfigRFWithTxPwrTrackHeaderFile(&pHalData->odmpriv);
 	}
 
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +4 -5
index ca6ad9659b09..505e122bdfb5 100644
@@ -23,8 +23,7 @@ static u8 rtw_sdio_wait_enough_TxOQT_space(struct adapter *padapter, u8 agg_num)
 	u32 n = 0;
 	struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
 
-	while (pHalData->SdioTxOQTFreeSpace < agg_num)
-	{
+	while (pHalData->SdioTxOQTFreeSpace < agg_num) {
 		if (
 			(padapter->bSurpriseRemoved == true) ||
 			(padapter->bDriverStopped == true)
@@ -299,7 +298,8 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 				) {
 					if (pxmitbuf) {
 						/* pxmitbuf->priv_data will be NULL, and will crash here */
-						if (pxmitbuf->len > 0 && pxmitbuf->priv_data) {
+						if (pxmitbuf->len > 0 &&
+						    pxmitbuf->priv_data) {
 							struct xmit_frame *pframe;
 							pframe = (struct xmit_frame*)pxmitbuf->priv_data;
 							pframe->agg_num = k;
@@ -400,8 +400,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 				pxmitbuf->priv_data = NULL;
 				enqueue_pending_xmitbuf(pxmitpriv, pxmitbuf);
 				yield();
-			}
-			else
+			} else
 				rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
 			pxmitbuf = NULL;
 		}
Signature · 1 line
2.12.2
#6 lore raw

Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional

Quoted 44 lines · Justin Vreeland

Ensure checkpatch compliance

Quoted 1 line

---
v2:
  - Added commit message
  - Fixed overly long lines

 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 18 ++++++++---------- drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 12 ++++++------ drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c  |  9 ++++-----

 3 files changed, 18 insertions(+), 21 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
index 28d1a229c3a6..21ec890fd60c 100644
@@ -385,8 +385,7 @@ s32 PHY_MACConfig8723B(struct adapter *Adapter)
Quoted 9 lines

  /*  Config MAC */
  /*  */
  rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile);

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (rtStatus == _FAIL)
-	{
+	if (rtStatus == _FAIL) {

  ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv); rtStatus = _SUCCESS;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -459,8 +458,7 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 9 lines

  Adapter->registrypriv.RegEnableTxPowerLimit == 1 || (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL)
-		{
+		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -474,8 +472,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 6 lines

  /*  */
  /*  1. Read PHY_REG.TXT BB INIT!! */
  /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) ==

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c

Quoted 1 line
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+		_FAIL) {

This and...

Quoted 21 lines

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))

Quoted 2 lines

  rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -491,8 +489,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 10 lines

  Adapter->registrypriv.RegEnableTxPowerByRate == 1 || (Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +2 -2
-		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == _FAIL)
-		{
+		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) ==
+			_FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -514,8 +512,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 6 lines

  /*  */
  /*  2. Read BB AGC table Initialization */ /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, CONFIG_BB_AGC_TAB) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile,

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) · line 516

Quoted 1 line
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+				     CONFIG_BB_AGC_TAB) == _FAIL) {

...this and the other such changes below are just way ugly, whatever the coding style says.

#7 lore raw

Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional

Quoted 74 lines · Bastien Nocera
Quoted 44 lines · Justin Vreeland

Ensure checkpatch compliance

Quoted 1 line

---
v2:
  - Added commit message
  - Fixed overly long lines

 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 18 ++++++++---------- drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 12 ++++++------ drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c  |  9 ++++-----

 3 files changed, 18 insertions(+), 21 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
index 28d1a229c3a6..21ec890fd60c 100644
@@ -385,8 +385,7 @@ s32 PHY_MACConfig8723B(struct adapter *Adapter)
Quoted 9 lines

  /*  Config MAC */
  /*  */
  rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile);

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (rtStatus == _FAIL)
-	{
+	if (rtStatus == _FAIL) {

  ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv); rtStatus = _SUCCESS;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -459,8 +458,7 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 9 lines

  Adapter->registrypriv.RegEnableTxPowerLimit == 1 || (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL)
-		{
+		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -474,8 +472,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 6 lines

  /*  */
  /*  1. Read PHY_REG.TXT BB INIT!! */
  /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) ==

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c

Quoted 1 line
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+		_FAIL) {

This and...

Quoted 21 lines

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))

Quoted 2 lines

  rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -491,8 +489,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 10 lines

  Adapter->registrypriv.RegEnableTxPowerByRate == 1 || (Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +2 -2
-		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == _FAIL)
-		{
+		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) ==
+			_FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -514,8 +512,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 6 lines

  /*  */
  /*  2. Read BB AGC table Initialization */ /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, CONFIG_BB_AGC_TAB) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile,

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) · line 516

Quoted 1 line
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+				     CONFIG_BB_AGC_TAB) == _FAIL) {

...this and the other such changes below are just way ugly, whatever the coding style says.

#8 lore raw

Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional

In reply to Bastien Nocera
Quoted 64 lines · Bastien Nocera
Quoted 44 lines · Justin Vreeland

Ensure checkpatch compliance

Quoted 1 line

---
v2:
  - Added commit message
  - Fixed overly long lines

 drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c | 18 ++++++++---------- drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c | 12 ++++++------ drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c  |  9 ++++-----

 3 files changed, 18 insertions(+), 21 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
index 28d1a229c3a6..21ec890fd60c 100644
@@ -385,8 +385,7 @@ s32 PHY_MACConfig8723B(struct adapter *Adapter)
Quoted 9 lines

  /*  Config MAC */
  /*  */
  rtStatus = phy_ConfigMACWithParaFile(Adapter, pszMACRegFile);

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (rtStatus == _FAIL)
-	{
+	if (rtStatus == _FAIL) {

  ODM_ConfigMACWithHeaderFile(&pHalData->odmpriv); rtStatus = _SUCCESS;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -459,8 +458,7 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 9 lines

  Adapter->registrypriv.RegEnableTxPowerLimit == 1 || (Adapter->registrypriv.RegEnableTxPowerLimit == 2 && pHalData->EEPROMRegulatory == 1) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL)
-		{
+		if (PHY_ConfigRFWithPowerLimitTableParaFile(Adapter, pszRFTxPwrLmtFile) == _FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_TXPWR_LMT, (ODM_RF_RADIO_PATH_E)0)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -474,8 +472,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 6 lines

  /*  */
  /*  1. Read PHY_REG.TXT BB INIT!! */
  /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszBBRegFile, CONFIG_BB_PHY_REG) ==

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c

Quoted 1 line
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+		_FAIL) {

This and...

Quoted 15 lines

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG))

Quoted 2 lines

  rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -491,8 +489,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 10 lines

  Adapter->registrypriv.RegEnableTxPowerByRate == 1 || (Adapter->registrypriv.RegEnableTxPowerByRate == 2 && pHalData->EEPROMRegulatory != 2) ) {

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +2 -2
-		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) == _FAIL)
-		{
+		if (phy_ConfigBBWithPgParaFile(Adapter, pszBBRegPgFile) ==
+			_FAIL) {

  if (HAL_STATUS_SUCCESS != ODM_ConfigBBWithHeaderFile(&pHalData->odmpriv, CONFIG_BB_PHY_REG_PG)) rtStatus = _FAIL;
  }

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +0 -0
@@ -514,8 +512,8 @@ static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter)
Quoted 10 lines

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c static int phy_BB8723b_Config_ParaFile(struct adapter *Adapter) · line 516

Quoted 7 lines
Quoted 6 lines

  /*  */
  /*  2. Read BB AGC table Initialization */ /*  */

drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -2
-	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile, CONFIG_BB_AGC_TAB) == _FAIL)
-	{
+	if (phy_ConfigBBWithParaFile(Adapter, pszAGCTableFile,
drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c +1 -0
+				     CONFIG_BB_AGC_TAB) == _FAIL) {

...this and the other such changes below are just way ugly, whatever the coding style says.

Sorry about blank email.

I'm not 100% happy with it either. Larry Finger suggested to fix the overly long lines so I tried to find a decent way to shorten them. I think the best way would be to change the function names or pull the function calls out of the if statements.

If these line breaks aren't a good solution and keeping them over 80 isn't either I'd rather drop this patch from the set if that's okay.

--Justin

#9 lore raw

Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional

Quoted 1 line · Justin Vreeland

<snip>

Quoted 11 lines

Sorry about blank email.

I'm not 100% happy with it either.  Larry Finger suggested to fix the overly long lines so I tried to find a decent way to shorten them.  I think the best way would be to change the function names or pull the function
calls out of the if statements.

If these line breaks aren't a good solution and keeping them over 80 isn't either I'd
rather drop this patch from the set if that's okay.

Dropping the sections of this patch that require linefeeds in the middle of if statements would be fine by me. I don't think that a brace on the next line is worse than splitting a condition on 2 lines.

Cheers

#10 lore raw

PATCH v2 5/7 staging: rtl8723bs: Fix pointer style

In reply to Justin Vreeland

Fix "(foo*)" should be "(foo *)"
Fix "foo * bar" should be "foo *bar"

---
v2:
- Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +3 -3
index 505e122bdfb5..7978a987b31c 100644
@@ -58,7 +58,7 @@ static s32 rtl8723_dequeue_writeport(struct adapter *padapter)
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 	struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter);
 	struct xmit_buf *pxmitbuf;
-	struct adapter * pri_padapter = padapter;
+	struct adapter *pri_padapter = padapter;
 	s32 ret = 0;
 	u8 PageIdx = 0;
 	u32 deviceId;
@@ -301,7 +301,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 						if (pxmitbuf->len > 0 &&
 						    pxmitbuf->priv_data) {
 							struct xmit_frame *pframe;
-							pframe = (struct xmit_frame*)pxmitbuf->priv_data;
+							pframe = (struct xmit_frame *)pxmitbuf->priv_data;
 							pframe->agg_num = k;
 							pxmitbuf->agg_num = k;
 							rtl8723b_update_txdesc(pframe, pframe->buf_addr);
@@ -392,7 +392,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 
 			if (pxmitbuf->len > 0) {
 				struct xmit_frame *pframe;
-				pframe = (struct xmit_frame*)pxmitbuf->priv_data;
+				pframe = (struct xmit_frame *)pxmitbuf->priv_data;
 				pframe->agg_num = k;
 				pxmitbuf->agg_num = k;
 				rtl8723b_update_txdesc(pframe, pframe->buf_addr);
Signature · 1 line
2.12.2
#11 lore raw

PATCH v2 6/7 staging: rtl8723bs: Fix spacing around '<'

In reply to Justin Vreeland

Ensure checkpatch compliance

---
v2:
- Added commit message
- Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +1 -1
index 7978a987b31c..d654b3438af1 100644
@@ -230,7 +230,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
 	pxmitbuf = NULL;
 
 	if (padapter->registrypriv.wifi_spec == 1) {
-		for (idx = 0; idx<4; idx++)
+		for (idx = 0; idx < 4; idx++)
 			inx[idx] = pxmitpriv->wmm_para_seq[idx];
 	} else {
 		inx[0] = 0;
Signature · 1 line
2.12.2
#12 lore raw

PATCH v2 7/7 staging: rtl8723bs: Do not use assignment in if condition

In reply to Justin Vreeland

Ensure checkpatch compliance

---
v2:
- Added commit message
- Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +2 -1
index d654b3438af1..9bee2e40be32 100644
@@ -610,7 +610,8 @@ s32	rtl8723bs_hal_xmitframe_enqueue(
 	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
 	s32 err;
 
-	if ((err = rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS) {
+	err = rtw_xmitframe_enqueue(padapter, pxmitframe);
+	if (err != _SUCCESS) {
 		rtw_free_xmitframe(pxmitpriv, pxmitframe);
 
 		pxmitpriv->tx_drop++;
Signature · 1 line
2.12.2
Reviewed-by on the v2 series
#13 lore raw
In reply to Justin Vreeland
Quoted 11 lines · Justin Vreeland

v2:
  Added commit messages
  Fixed overly long lines
  Added Bastien Nocera's Reviewed-by tag
    - Also fixed commit messages marked reviewed, hope that's OK. The patch
      contents are identical.

Justin Vreeland (7):
  staging: rtl8723bs: Fix initialization of static variables
  staging: rtl8723bs: Wrap multi-line macros in do-while loop

You can add:

for those 2.

Cheers