All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes
@ 2017-05-02  0:52 Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 1/7] staging: rtl8723bs: Fix initialization of static variables Justin Vreeland
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, 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
  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(-)

-- 
2.12.2

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

* [PATCH v2 1/7] staging: rtl8723bs: Fix initialization of static variables
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 2/7] staging: rtl8723bs: Wrap multi-line macros in do-while loop Justin Vreeland
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

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

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
---
 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(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
index 86040adb436c..37f42bfc55ed 100644
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
@@ -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"));
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
index f5bc511d02f2..33610d39333f 100644
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c
@@ -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"));
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
index cc7e0903ee9d..9e08a4de4895 100644
--- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c
+++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
@@ -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;
 
diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c
index ba8e8eb534ef..202c52f488ae 100644
--- a/drivers/staging/rtl8723bs/hal/odm_DIG.c
+++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c
@@ -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"));
 
-- 
2.12.2

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

* [PATCH v2 2/7] staging: rtl8723bs: Wrap multi-line macros in do-while loop
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 1/7] staging: rtl8723bs: Fix initialization of static variables Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses Justin Vreeland
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

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

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
---
v2:
  - Added commit message

 drivers/staging/rtl8723bs/hal/odm_debug.h | 81 +++++++++++++++++--------------
 1 file changed, 45 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm_debug.h b/drivers/staging/rtl8723bs/hal/odm_debug.h
index 2ec4baf57464..ff131361248c 100644
--- a/drivers/staging/rtl8723bs/hal/odm_debug.h
+++ b/drivers/staging/rtl8723bs/hal/odm_debug.h
@@ -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
-- 
2.12.2

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

* [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 1/7] staging: rtl8723bs: Fix initialization of static variables Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 2/7] staging: rtl8723bs: Wrap multi-line macros in do-while loop Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-04 11:30   ` Bastien Nocera
  2017-05-02  0:52 ` [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional Justin Vreeland
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

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

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
---
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(-)

diff --git a/drivers/staging/rtl8723bs/hal/odm.h b/drivers/staging/rtl8723bs/hal/odm.h
index 0b3541a91548..87a76bafecb3 100644
--- a/drivers/staging/rtl8723bs/hal/odm.h
+++ b/drivers/staging/rtl8723bs/hal/odm.h
@@ -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
-- 
2.12.2

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

* [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
                   ` (2 preceding siblings ...)
  2017-05-02  0:52 ` [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-04 11:30   ` Bastien Nocera
  2017-05-02  0:52 ` [PATCH v2 5/7] staging: rtl8723bs: Fix pointer style Justin Vreeland
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

Ensure checkpatch compliance

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
---
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(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
index 28d1a229c3a6..21ec890fd60c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
@@ -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;
 	}
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
index 3a85d0cddfda..a71b552eca9a 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_rf6052.c
@@ -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);
 	}
 
diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index ca6ad9659b09..505e122bdfb5 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -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;
 		}
-- 
2.12.2

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

* [PATCH v2 5/7] staging: rtl8723bs: Fix pointer style
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
                   ` (3 preceding siblings ...)
  2017-05-02  0:52 ` [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 6/7] staging: rtl8723bs: Fix spacing around '<' Justin Vreeland
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

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

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
---
v2:
  - Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index 505e122bdfb5..7978a987b31c 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -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);
-- 
2.12.2

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

* [PATCH v2 6/7] staging: rtl8723bs: Fix spacing around '<'
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
                   ` (4 preceding siblings ...)
  2017-05-02  0:52 ` [PATCH v2 5/7] staging: rtl8723bs: Fix pointer style Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-02  0:52 ` [PATCH v2 7/7] staging: rtl8723bs: Do not use assignment in if condition Justin Vreeland
  2017-05-04 11:31 ` [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Bastien Nocera
  7 siblings, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

Ensure checkpatch compliance

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
---
v2:
  - Added commit message
  - Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index 7978a987b31c..d654b3438af1 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -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;
-- 
2.12.2

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

* [PATCH v2 7/7] staging: rtl8723bs: Do not use assignment in if condition
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
                   ` (5 preceding siblings ...)
  2017-05-02  0:52 ` [PATCH v2 6/7] staging: rtl8723bs: Fix spacing around '<' Justin Vreeland
@ 2017-05-02  0:52 ` Justin Vreeland
  2017-05-04 11:31 ` [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Bastien Nocera
  7 siblings, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-02  0:52 UTC (permalink / raw)
  To: gregkh, hadess, Larry.Finger; +Cc: devel, linux-kernel, Justin Vreeland

Ensure checkpatch compliance

Signed-off-by: Justin Vreeland <justin@jvreeland.com>
Reviewed-by: Bastien Nocera <hadess@hadess.net>
---
v2:
  - Added commit message
  - Added Reviewed-by tag

 drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
index d654b3438af1..9bee2e40be32 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c
@@ -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++;
-- 
2.12.2

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

* Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional
  2017-05-02  0:52 ` [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional Justin Vreeland
@ 2017-05-04 11:30   ` Bastien Nocera
  2017-05-05 22:01     ` Justin Vreeland
  2017-05-05 22:10     ` Justin Vreeland
  0 siblings, 2 replies; 14+ messages in thread
From: Bastien Nocera @ 2017-05-04 11:30 UTC (permalink / raw)
  To: Justin Vreeland, gregkh, Larry.Finger; +Cc: devel, linux-kernel

On Mon, 2017-05-01 at 18:52 -0600, Justin Vreeland wrote:
> Ensure checkpatch compliance
> 
> > Signed-off-by: Justin Vreeland <justin@jvreeland.com>
> ---
> 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(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
> index 28d1a229c3a6..21ec890fd60c 100644
> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
> @@ -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) {

This and...

>  		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) {

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

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

* Re: [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses
  2017-05-02  0:52 ` [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses Justin Vreeland
@ 2017-05-04 11:30   ` Bastien Nocera
  0 siblings, 0 replies; 14+ messages in thread
From: Bastien Nocera @ 2017-05-04 11:30 UTC (permalink / raw)
  To: Justin Vreeland, gregkh, Larry.Finger; +Cc: devel, linux-kernel

On Mon, 2017-05-01 at 18:52 -0600, Justin Vreeland wrote:
> Enclosing macros with complex values ensures expression is evaluated
> as
> expected.
> 
> Signed-off-by: Justin Vreeland <justin@jvreeland.com>
> ---
> 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(-)
> 
> diff --git a/drivers/staging/rtl8723bs/hal/odm.h
> b/drivers/staging/rtl8723bs/hal/odm.h
> index 0b3541a91548..87a76bafecb3 100644
> --- a/drivers/staging/rtl8723bs/hal/odm.h
> +++ b/drivers/staging/rtl8723bs/hal/odm.h
> @@ -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
> +						*/

This does line up when applied, right? If so:
Reviewed-by: Bastien Nocera <hadess@hadess.net>

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

* Re: [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes
  2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
                   ` (6 preceding siblings ...)
  2017-05-02  0:52 ` [PATCH v2 7/7] staging: rtl8723bs: Do not use assignment in if condition Justin Vreeland
@ 2017-05-04 11:31 ` Bastien Nocera
  7 siblings, 0 replies; 14+ messages in thread
From: Bastien Nocera @ 2017-05-04 11:31 UTC (permalink / raw)
  To: Justin Vreeland, gregkh, Larry.Finger; +Cc: devel, linux-kernel

On Mon, 2017-05-01 at 18:52 -0600, Justin Vreeland wrote:
> 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:
Reviewed-by: Bastien Nocera <hadess@hadess.net>
for those 2.

Cheers

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

* Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional
  2017-05-04 11:30   ` Bastien Nocera
@ 2017-05-05 22:01     ` Justin Vreeland
  2017-05-05 22:10     ` Justin Vreeland
  1 sibling, 0 replies; 14+ messages in thread
From: Justin Vreeland @ 2017-05-05 22:01 UTC (permalink / raw)
  To: Bastien Nocera, gregkh, Larry.Finger; +Cc: devel, linux-kernel

Bastien Nocera <hadess@hadess.net> writes:

> On Mon, 2017-05-01 at 18:52 -0600, Justin Vreeland wrote:
>> Ensure checkpatch compliance
>> 
>> > Signed-off-by: Justin Vreeland <justin@jvreeland.com>
>> ---
>> 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(-)
>> 
>> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> index 28d1a229c3a6..21ec890fd60c 100644
>> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> @@ -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) {
>
> This and...
>
>>  		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) {
>
> ...this and the other such changes below are just way ugly, whatever
> the coding style says.

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

* Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional
  2017-05-04 11:30   ` Bastien Nocera
  2017-05-05 22:01     ` Justin Vreeland
@ 2017-05-05 22:10     ` Justin Vreeland
  2017-05-06  9:32       ` Bastien Nocera
  1 sibling, 1 reply; 14+ messages in thread
From: Justin Vreeland @ 2017-05-05 22:10 UTC (permalink / raw)
  To: Bastien Nocera, gregkh, Larry.Finger; +Cc: devel, linux-kernel


Bastien Nocera <hadess@hadess.net> writes:

> On Mon, 2017-05-01 at 18:52 -0600, Justin Vreeland wrote:
>> Ensure checkpatch compliance
>> 
>> > Signed-off-by: Justin Vreeland <justin@jvreeland.com>
>> ---
>> 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(-)
>> 
>> diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> index 28d1a229c3a6..21ec890fd60c 100644
>> --- a/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_phycfg.c
>> @@ -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) {
>
> This and...
>
>>  		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) {
>
> ...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

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

* Re: [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional
  2017-05-05 22:10     ` Justin Vreeland
@ 2017-05-06  9:32       ` Bastien Nocera
  0 siblings, 0 replies; 14+ messages in thread
From: Bastien Nocera @ 2017-05-06  9:32 UTC (permalink / raw)
  To: Justin Vreeland, gregkh, Larry.Finger; +Cc: devel, linux-kernel

On Fri, 2017-05-05 at 16:10 -0600, Justin Vreeland wrote:
> 
<snip>
> 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

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

end of thread, other threads:[~2017-05-06  9:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-02  0:52 [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Justin Vreeland
2017-05-02  0:52 ` [PATCH v2 1/7] staging: rtl8723bs: Fix initialization of static variables Justin Vreeland
2017-05-02  0:52 ` [PATCH v2 2/7] staging: rtl8723bs: Wrap multi-line macros in do-while loop Justin Vreeland
2017-05-02  0:52 ` [PATCH v2 3/7] staging: rtl8723bs: Macros with complex values should be enclosed in parentheses Justin Vreeland
2017-05-04 11:30   ` Bastien Nocera
2017-05-02  0:52 ` [PATCH v2 4/7] staging: rtl8723bs: Move braces to same line as conditional Justin Vreeland
2017-05-04 11:30   ` Bastien Nocera
2017-05-05 22:01     ` Justin Vreeland
2017-05-05 22:10     ` Justin Vreeland
2017-05-06  9:32       ` Bastien Nocera
2017-05-02  0:52 ` [PATCH v2 5/7] staging: rtl8723bs: Fix pointer style Justin Vreeland
2017-05-02  0:52 ` [PATCH v2 6/7] staging: rtl8723bs: Fix spacing around '<' Justin Vreeland
2017-05-02  0:52 ` [PATCH v2 7/7] staging: rtl8723bs: Do not use assignment in if condition Justin Vreeland
2017-05-04 11:31 ` [PATCH v2 0/7] staging: rtl8732: Various checkpatch fixes Bastien Nocera

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.