All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: Fix checkpatch warnings
@ 2022-03-23 11:38 Sathish Kumar
  2022-03-23 11:55 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Sathish Kumar @ 2022-03-23 11:38 UTC (permalink / raw)
  To: gregkh, linux-staging, linux-kernel; +Cc: Sathish Kumar

This patch fixes the checkpatch.pl warnings like:
CHECK: Lines should not end with a '('
+               if (

CHECK: Please don't use multiple blank lines
+
+

CHECK: Blank lines aren't necessary before a close brace '}'
+
+}

CHECK: Unbalanced braces around else statement
+               } else /*  set grant_bt to high */

Signed-off-by: Sathish Kumar <skumark1902@gmail.com>
---
 .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c   | 842 ++++++++++--------
 1 file changed, 453 insertions(+), 389 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
index b3d7f50fac4c..d4caff824dd5 100644
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
@@ -15,9 +15,9 @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant;
 
 /*  local function proto type if needed */
 /*  local function start with halbtc8723b1ant_ */
-static u8 halbtc8723b1ant_BtRssiState(
-	u8 levelNum, u8 rssiThresh, u8 rssiThresh1
-)
+static u8 halbtc8723b1ant_BtRssiState(u8 levelNum,
+				      u8 rssiThresh,
+				      u8 rssiThresh1)
 {
 	s32 btRssi = 0;
 	u8 btRssiState = pCoexSta->preBtRssiState;
@@ -25,10 +25,8 @@ static u8 halbtc8723b1ant_BtRssiState(
 	btRssi = pCoexSta->btRssi;
 
 	if (levelNum == 2) {
-		if (
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
-		) {
+		if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
+		    (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)) {
 			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
 
 				btRssiState = BTC_RSSI_STATE_HIGH;
@@ -44,18 +42,14 @@ static u8 halbtc8723b1ant_BtRssiState(
 		if (rssiThresh > rssiThresh1)
 			return pCoexSta->preBtRssiState;
 
-		if (
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
-		) {
+		if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
+		    (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)) {
 			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
 				btRssiState = BTC_RSSI_STATE_MEDIUM;
 			else
 				btRssiState = BTC_RSSI_STATE_STAY_LOW;
-		} else if (
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
-			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)
-		) {
+		} else if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
+			   (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)) {
 			if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
 				btRssiState = BTC_RSSI_STATE_HIGH;
 			else if (btRssi < rssiThresh)
@@ -75,24 +69,22 @@ static u8 halbtc8723b1ant_BtRssiState(
 	return btRssiState;
 }
 
-static void halbtc8723b1ant_UpdateRaMask(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u32 disRateMask
-)
+static void halbtc8723b1ant_UpdateRaMask(struct btc_coexist *pBtCoexist,
+					 bool bForceExec,
+					 u32 disRateMask)
 {
 	pCoexDm->curRaMask = disRateMask;
 
 	if (bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
-		pBtCoexist->fBtcSet(
-			pBtCoexist,
-			BTC_SET_ACT_UPDATE_RAMASK,
-			&pCoexDm->curRaMask
-		);
+		pBtCoexist->fBtcSet(pBtCoexist,
+				    BTC_SET_ACT_UPDATE_RAMASK,
+				    &pCoexDm->curRaMask);
 	pCoexDm->preRaMask = pCoexDm->curRaMask;
 }
 
-static void halbtc8723b1ant_AutoRateFallbackRetry(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
-)
+static void halbtc8723b1ant_AutoRateFallbackRetry(struct btc_coexist *pBtCoexist,
+						  bool bForceExec,
+						  u8 type)
 {
 	bool bWifiUnderBMode = false;
 
@@ -101,17 +93,17 @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
 	if (bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
 		switch (pCoexDm->curArfrType) {
 		case 0:	/*  normal mode */
-			pBtCoexist->fBtcWrite4Byte(
-				pBtCoexist, 0x430, pCoexDm->backupArfrCnt1
-			);
-			pBtCoexist->fBtcWrite4Byte(
-				pBtCoexist, 0x434, pCoexDm->backupArfrCnt2
-			);
+			pBtCoexist->fBtcWrite4Byte(pBtCoexist,
+						   0x430,
+						   pCoexDm->backupArfrCnt1);
+			pBtCoexist->fBtcWrite4Byte(pBtCoexist,
+						   0x434,
+						   pCoexDm->backupArfrCnt2);
 			break;
 		case 1:
-			pBtCoexist->fBtcGet(
-				pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
-			);
+			pBtCoexist->fBtcGet(pBtCoexist,
+					    BTC_GET_BL_WIFI_UNDER_B_MODE,
+					    &bWifiUnderBMode);
 			if (bWifiUnderBMode) {
 				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
 				pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101);
@@ -128,21 +120,19 @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
 	pCoexDm->preArfrType = pCoexDm->curArfrType;
 }
 
-static void halbtc8723b1ant_RetryLimit(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
-)
+static void halbtc8723b1ant_RetryLimit(struct btc_coexist *pBtCoexist,
+				       bool bForceExec,
+				       u8 type)
 {
 	pCoexDm->curRetryLimitType = type;
 
-	if (
-		bForceExec ||
-		(pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)
-	) {
+	if (bForceExec ||
+	    (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)) {
 		switch (pCoexDm->curRetryLimitType) {
 		case 0:	/*  normal mode */
-			pBtCoexist->fBtcWrite2Byte(
-				pBtCoexist, 0x42a, pCoexDm->backupRetryLimit
-			);
+			pBtCoexist->fBtcWrite2Byte(pBtCoexist,
+						   0x42a,
+						   pCoexDm->backupRetryLimit);
 			break;
 		case 1:	/*  retry limit =8 */
 			pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808);
@@ -155,20 +145,19 @@ static void halbtc8723b1ant_RetryLimit(
 	pCoexDm->preRetryLimitType = pCoexDm->curRetryLimitType;
 }
 
-static void halbtc8723b1ant_AmpduMaxTime(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
-)
+static void halbtc8723b1ant_AmpduMaxTime(struct btc_coexist *pBtCoexist,
+					 bool bForceExec,
+					 u8 type)
 {
 	pCoexDm->curAmpduTimeType = type;
 
-	if (
-		bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
-	) {
+	if (bForceExec ||
+	    (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)) {
 		switch (pCoexDm->curAmpduTimeType) {
 		case 0:	/*  normal mode */
-			pBtCoexist->fBtcWrite1Byte(
-				pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime
-			);
+			pBtCoexist->fBtcWrite1Byte(pBtCoexist,
+						   0x456,
+						   pCoexDm->backupAmpduMaxTime);
 			break;
 		case 1:	/*  AMPDU timw = 0x38 * 32us */
 			pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38);
@@ -181,14 +170,12 @@ static void halbtc8723b1ant_AmpduMaxTime(
 	pCoexDm->preAmpduTimeType = pCoexDm->curAmpduTimeType;
 }
 
-static void halbtc8723b1ant_LimitedTx(
-	struct btc_coexist *pBtCoexist,
-	bool bForceExec,
-	u8 raMaskType,
-	u8 arfrType,
-	u8 retryLimitType,
-	u8 ampduTimeType
-)
+static void halbtc8723b1ant_LimitedTx(struct btc_coexist *pBtCoexist,
+				      bool bForceExec,
+				      u8 raMaskType,
+				      u8 arfrType,
+				      u8 retryLimitType,
+				      u8 ampduTimeType)
 {
 	switch (raMaskType) {
 	case 0:	/*  normal mode */
@@ -209,13 +196,11 @@ static void halbtc8723b1ant_LimitedTx(
 	halbtc8723b1ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType);
 }
 
-static void halbtc8723b1ant_LimitedRx(
-	struct btc_coexist *pBtCoexist,
-	bool bForceExec,
-	bool bRejApAggPkt,
-	bool bBtCtrlAggBufSize,
-	u8 aggBufSize
-)
+static void halbtc8723b1ant_LimitedRx(struct btc_coexist *pBtCoexist,
+				      bool bForceExec,
+				      bool bRejApAggPkt,
+				      bool bBtCtrlAggBufSize,
+				      u8 aggBufSize)
 {
 	bool bRejectRxAgg = bRejApAggPkt;
 	bool bBtCtrlRxAggSize = bBtCtrlAggBufSize;
@@ -224,13 +209,13 @@ static void halbtc8723b1ant_LimitedRx(
 	/*  */
 	/*	Rx Aggregation related setting */
 	/*  */
-	pBtCoexist->fBtcSet(
-		pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
-	);
+	pBtCoexist->fBtcSet(pBtCoexist,
+			    BTC_SET_BL_TO_REJ_AP_AGG_PKT,
+			    &bRejectRxAgg);
 	/*  decide BT control aggregation buf size or not */
-	pBtCoexist->fBtcSet(
-		pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
-	);
+	pBtCoexist->fBtcSet(pBtCoexist,
+			    BTC_SET_BL_BT_CTRL_AGG_SIZE,
+			    &bBtCtrlRxAggSize);
 	/*  aggregation buf size, only work when BT control Rx aggregation size. */
 	pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
 	/*  real update aggregation setting */
@@ -307,9 +292,9 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
 
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi);
-	pBtCoexist->fBtcGet(
-		pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
-	);
+	pBtCoexist->fBtcGet(pBtCoexist,
+			    BTC_GET_BL_WIFI_UNDER_B_MODE,
+			    &bWifiUnderBMode);
 
 	if (pCoexSta->bUnderIps) {
 		pCoexSta->nCRCOK_CCK = 0;
@@ -333,31 +318,23 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
 		pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba);
 	}
 
-
 	/* reset counter */
 	pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1);
 	pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0);
 
 	if (bWifiBusy && (wifiRssi >= 30) && !bWifiUnderBMode) {
-		if (
-			(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
-			(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
-			(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY)
-		) {
-			if (
-				pCoexSta->nCRCOK_CCK > (
-					pCoexSta->nCRCOK_11g +
-					pCoexSta->nCRCOK_11n +
-					pCoexSta->nCRCOK_11nAgg
-				)
-			) {
+		if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
+		    (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
+		    (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY)) {
+			if (pCoexSta->nCRCOK_CCK > (pCoexSta->nCRCOK_11g +
+						    pCoexSta->nCRCOK_11n +
+						    pCoexSta->nCRCOK_11nAgg)) {
 				if (nCCKLockCounter < 5)
 					nCCKLockCounter++;
 			} else {
 				if (nCCKLockCounter > 0)
 					nCCKLockCounter--;
 			}
-
 		} else {
 			if (nCCKLockCounter > 0)
 				nCCKLockCounter--;
@@ -368,7 +345,6 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
 	}
 
 	if (!pCoexSta->bPreCCKLock) {
-
 		if (nCCKLockCounter >= 5)
 			pCoexSta->bCCKLock = true;
 		else
@@ -381,8 +357,6 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
 	}
 
 	pCoexSta->bPreCCKLock =  pCoexSta->bCCKLock;
-
-
 }
 
 static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
@@ -391,14 +365,14 @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
 	bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false;
 	bool bWifiConnected = false;
 
-	pBtCoexist->fBtcGet(
-		pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
-	);
+	pBtCoexist->fBtcGet(pBtCoexist,
+			    BTC_GET_BL_WIFI_CONNECTED,
+			    &bWifiConnected);
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
-	pBtCoexist->fBtcGet(
-		pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
-	);
+	pBtCoexist->fBtcGet(pBtCoexist,
+			    BTC_GET_BL_WIFI_4_WAY_PROGRESS,
+			    &bUnder4way);
 
 	if (bWifiConnected) {
 		if (bWifiBusy != bPreWifiBusy) {
@@ -440,45 +414,37 @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist)
 	}
 
 	/*  check if Sco only */
-	if (
-		pBtLinkInfo->bScoExist &&
-		!pBtLinkInfo->bA2dpExist &&
-		!pBtLinkInfo->bPanExist &&
-		!pBtLinkInfo->bHidExist
-	)
+	if (pBtLinkInfo->bScoExist &&
+	    !pBtLinkInfo->bA2dpExist &&
+	    !pBtLinkInfo->bPanExist &&
+	    !pBtLinkInfo->bHidExist)
 		pBtLinkInfo->bScoOnly = true;
 	else
 		pBtLinkInfo->bScoOnly = false;
 
 	/*  check if A2dp only */
-	if (
-		!pBtLinkInfo->bScoExist &&
-		pBtLinkInfo->bA2dpExist &&
-		!pBtLinkInfo->bPanExist &&
-		!pBtLinkInfo->bHidExist
-	)
+	if (!pBtLinkInfo->bScoExist &&
+	    pBtLinkInfo->bA2dpExist &&
+	    !pBtLinkInfo->bPanExist &&
+	    !pBtLinkInfo->bHidExist)
 		pBtLinkInfo->bA2dpOnly = true;
 	else
 		pBtLinkInfo->bA2dpOnly = false;
 
 	/*  check if Pan only */
-	if (
-		!pBtLinkInfo->bScoExist &&
-		!pBtLinkInfo->bA2dpExist &&
-		pBtLinkInfo->bPanExist &&
-		!pBtLinkInfo->bHidExist
-	)
+	if (!pBtLinkInfo->bScoExist &&
+	    !pBtLinkInfo->bA2dpExist &&
+	    pBtLinkInfo->bPanExist &&
+	    !pBtLinkInfo->bHidExist)
 		pBtLinkInfo->bPanOnly = true;
 	else
 		pBtLinkInfo->bPanOnly = false;
 
 	/*  check if Hid only */
-	if (
-		!pBtLinkInfo->bScoExist &&
-		!pBtLinkInfo->bA2dpExist &&
-		!pBtLinkInfo->bPanExist &&
-		pBtLinkInfo->bHidExist
-	)
+	if (!pBtLinkInfo->bScoExist &&
+	    !pBtLinkInfo->bA2dpExist &&
+	    !pBtLinkInfo->bPanExist &&
+	    pBtLinkInfo->bHidExist)
 		pBtLinkInfo->bHidOnly = true;
 	else
 		pBtLinkInfo->bHidOnly = false;
@@ -565,11 +531,9 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
 					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
 			}
 		} else {
-			if (
-				pBtLinkInfo->bHidExist &&
-				pBtLinkInfo->bPanExist &&
-				pBtLinkInfo->bA2dpExist
-			) {
+			if (pBtLinkInfo->bHidExist &&
+			    pBtLinkInfo->bPanExist &&
+			    pBtLinkInfo->bA2dpExist) {
 				if (bBtHsOn)
 					algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
 				else
@@ -578,14 +542,11 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
 		}
 	} else if (numOfDiffProfile >= 3) {
 		if (pBtLinkInfo->bScoExist) {
-			if (
-				pBtLinkInfo->bHidExist &&
-				pBtLinkInfo->bPanExist &&
-				pBtLinkInfo->bA2dpExist
-			) {
+			if (pBtLinkInfo->bHidExist &&
+			    pBtLinkInfo->bPanExist &&
+			    pBtLinkInfo->bA2dpExist) {
 				if (!bBtHsOn)
 					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
-
 			}
 		}
 	}
@@ -593,9 +554,8 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
 	return algorithm;
 }
 
-static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
-	struct btc_coexist *pBtCoexist, bool bLowPenaltyRa
-)
+static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(struct btc_coexist *pBtCoexist,
+						       bool bLowPenaltyRa)
 {
 	u8 H2C_Parameter[6] = {0};
 
@@ -612,9 +572,9 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
 	pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter);
 }
 
-static void halbtc8723b1ant_LowPenaltyRa(
-	struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa
-)
+static void halbtc8723b1ant_LowPenaltyRa(struct btc_coexist *pBtCoexist,
+					 bool bForceExec,
+					 bool bLowPenaltyRa)
 {
 	pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
 
@@ -622,20 +582,17 @@ static void halbtc8723b1ant_LowPenaltyRa(
 		if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
 			return;
 	}
-	halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
-		pBtCoexist, pCoexDm->bCurLowPenaltyRa
-	);
+	halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(pBtCoexist,
+						   pCoexDm->bCurLowPenaltyRa);
 
 	pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa;
 }
 
-static void halbtc8723b1ant_SetCoexTable(
-	struct btc_coexist *pBtCoexist,
-	u32 val0x6c0,
-	u32 val0x6c4,
-	u32 val0x6c8,
-	u8 val0x6cc
-)
+static void halbtc8723b1ant_SetCoexTable(struct btc_coexist *pBtCoexist,
+					 u32 val0x6c0,
+					 u32 val0x6c4,
+					 u32 val0x6c8,
+					 u8 val0x6cc)
 {
 	pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0);
 
@@ -646,14 +603,12 @@ static void halbtc8723b1ant_SetCoexTable(
 	pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc);
 }
 
-static void halbtc8723b1ant_CoexTable(
-	struct btc_coexist *pBtCoexist,
-	bool bForceExec,
-	u32 val0x6c0,
-	u32 val0x6c4,
-	u32 val0x6c8,
-	u8 val0x6cc
-)
+static void halbtc8723b1ant_CoexTable(struct btc_coexist *pBtCoexist,
+				      bool bForceExec,
+				      u32 val0x6c0,
+				      u32 val0x6c4,
+				      u32 val0x6c8,
+				      u8 val0x6cc)
 {
 	pCoexDm->curVal0x6c0 = val0x6c0;
 	pCoexDm->curVal0x6c4 = val0x6c4;
@@ -661,18 +616,18 @@ static void halbtc8723b1ant_CoexTable(
 	pCoexDm->curVal0x6cc = val0x6cc;
 
 	if (!bForceExec) {
-		if (
-			(pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
+		if ((pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
 		    (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
 		    (pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) &&
-		    (pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc)
-		)
+		    (pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc))
 			return;
 	}
 
-	halbtc8723b1ant_SetCoexTable(
-		pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
-	);
+	halbtc8723b1ant_SetCoexTable(pBtCoexist,
+				     val0x6c0,
+				     val0x6c4,
+				     val0x6c8,
+				     val0x6cc);
 
 	pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0;
 	pCoexDm->preVal0x6c4 = pCoexDm->curVal0x6c4;
@@ -680,61 +635,84 @@ static void halbtc8723b1ant_CoexTable(
 	pCoexDm->preVal0x6cc = pCoexDm->curVal0x6cc;
 }
 
-static void halbtc8723b1ant_CoexTableWithType(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
-)
+static void halbtc8723b1ant_CoexTableWithType(struct btc_coexist *pBtCoexist,
+					      bool bForceExec,
+					      u8 type)
 {
 	pCoexSta->nCoexTableType = type;
 
 	switch (type) {
 	case 0:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x55555555,
+					  0x55555555,
+					  0xffffff,
+					  0x3);
 		break;
 	case 1:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x55555555,
+					  0x5a5a5a5a,
+					  0xffffff,
+					  0x3);
 		break;
 	case 2:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x5a5a5a5a,
+					  0x5a5a5a5a,
+					  0xffffff,
+					  0x3);
 		break;
 	case 3:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0xaaaa5555,
+					  0xaaaa5a5a,
+					  0xffffff,
+					  0x3);
 		break;
 	case 4:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x55555555,
+					  0xaaaa5a5a,
+					  0xffffff,
+					  0x3);
 		break;
 	case 5:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x5a5a5a5a,
+					  0xaaaa5a5a,
+					  0xffffff,
+					  0x3);
 		break;
 	case 6:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0x55555555,
+					  0xaaaaaaaa,
+					  0xffffff,
+					  0x3);
 		break;
 	case 7:
-		halbtc8723b1ant_CoexTable(
-			pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
-		);
+		halbtc8723b1ant_CoexTable(pBtCoexist,
+					  bForceExec,
+					  0xaaaaaaaa,
+					  0xaaaaaaaa,
+					  0xffffff,
+					  0x3);
 		break;
 	default:
 		break;
 	}
 }
 
-static void halbtc8723b1ant_SetFwIgnoreWlanAct(
-	struct btc_coexist *pBtCoexist, bool bEnable
-)
+static void halbtc8723b1ant_SetFwIgnoreWlanAct(struct btc_coexist *pBtCoexist,
+					       bool bEnable)
 {
 	u8 H2C_Parameter[1] = {0};
 
@@ -744,9 +722,9 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct(
 	pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter);
 }
 
-static void halbtc8723b1ant_IgnoreWlanAct(
-	struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable
-)
+static void halbtc8723b1ant_IgnoreWlanAct(struct btc_coexist *pBtCoexist,
+					  bool bForceExec,
+					  bool bEnable)
 {
 	pCoexDm->bCurIgnoreWlanAct = bEnable;
 
@@ -759,9 +737,9 @@ static void halbtc8723b1ant_IgnoreWlanAct(
 	pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct;
 }
 
-static void halbtc8723b1ant_SetLpsRpwm(
-	struct btc_coexist *pBtCoexist, u8 lpsVal, u8 rpwmVal
-)
+static void halbtc8723b1ant_SetLpsRpwm(struct btc_coexist *pBtCoexist,
+				       u8 lpsVal,
+				       u8 rpwmVal)
 {
 	u8 lps = lpsVal;
 	u8 rpwm = rpwmVal;
@@ -770,18 +748,17 @@ static void halbtc8723b1ant_SetLpsRpwm(
 	pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm);
 }
 
-static void halbtc8723b1ant_LpsRpwm(
-	struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal
-)
+static void halbtc8723b1ant_LpsRpwm(struct btc_coexist *pBtCoexist,
+				    bool bForceExec,
+				    u8 lpsVal,
+				    u8 rpwmVal)
 {
 	pCoexDm->curLps = lpsVal;
 	pCoexDm->curRpwm = rpwmVal;
 
 	if (!bForceExec) {
-		if (
-			(pCoexDm->preLps == pCoexDm->curLps) &&
-			(pCoexDm->preRpwm == pCoexDm->curRpwm)
-		) {
+		if ((pCoexDm->preLps == pCoexDm->curLps) &&
+		    (pCoexDm->preRpwm == pCoexDm->curRpwm)) {
 			return;
 		}
 	}
@@ -791,16 +768,16 @@ static void halbtc8723b1ant_LpsRpwm(
 	pCoexDm->preRpwm = pCoexDm->curRpwm;
 }
 
-static void halbtc8723b1ant_SwMechanism(
-	struct btc_coexist *pBtCoexist, bool bLowPenaltyRA
-)
+static void halbtc8723b1ant_SwMechanism(struct btc_coexist *pBtCoexist,
+					bool bLowPenaltyRA)
 {
 	halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA);
 }
 
-static void halbtc8723b1ant_SetAntPath(
-	struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
-)
+static void halbtc8723b1ant_SetAntPath(struct btc_coexist *pBtCoexist,
+				       u8 antPosType,
+				       bool bInitHwCfg,
+				       bool bWifiOff)
 {
 	struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo;
 	u32 fwVer = 0, u4Tmp = 0, cntBtCalChk = 0;
@@ -840,8 +817,10 @@ static void halbtc8723b1ant_SetAntPath(
 			/* Use H2C to set GNT_BT to HIGH */
 			H2C_Parameter[0] = 1;
 			pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
-		} else /*  set grant_bt to high */
+		} else {
+			/*  set grant_bt to high */
 			pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
+		}
 
 		/* set wlan_act to always low */
 		pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
@@ -908,7 +887,6 @@ static void halbtc8723b1ant_SetAntPath(
 			}
 		}
 
-
 		/*  ext switch setting */
 		switch (antPosType) {
 		case BTC_ANT_PATH_WIFI:
@@ -958,7 +936,6 @@ static void halbtc8723b1ant_SetAntPath(
 			}
 		}
 
-
 		/*  internal switch setting */
 		switch (antPosType) {
 		case BTC_ANT_PATH_WIFI:
@@ -984,9 +961,12 @@ static void halbtc8723b1ant_SetAntPath(
 	}
 }
 
-static void halbtc8723b1ant_SetFwPstdma(
-	struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
-)
+static void halbtc8723b1ant_SetFwPstdma(struct btc_coexist *pBtCoexist,
+					u8 byte1,
+					u8 byte2,
+					u8 byte3,
+					u8 byte4,
+					u8 byte5)
 {
 	u8 H2C_Parameter[5] = {0};
 	u8 realByte1 = byte1, realByte5 = byte5;
@@ -1019,10 +999,10 @@ static void halbtc8723b1ant_SetFwPstdma(
 	pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter);
 }
 
-
-static void halbtc8723b1ant_PsTdma(
-	struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type
-)
+static void halbtc8723b1ant_PsTdma(struct btc_coexist *pBtCoexist,
+				   bool bForceExec,
+				   bool bTurnOn,
+				   u8 type)
 {
 	struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
 	bool bWifiBusy = false;
@@ -1037,10 +1017,8 @@ static void halbtc8723b1ant_PsTdma(
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
 
 	if (!bForceExec) {
-		if (
-			(pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
-			(pCoexDm->prePsTdma == pCoexDm->curPsTdma)
-		)
+		if ((pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
+		    (pCoexDm->prePsTdma == pCoexDm->curPsTdma))
 			return;
 	}
 
@@ -1057,210 +1035,299 @@ static void halbtc8723b1ant_PsTdma(
 		psTdmaByte4Val = 0x10; /*  0x778 = d/1 toggle */
 	}
 
-
 	if (bTurnOn) {
 		if (pBtLinkInfo->bSlaveRole)
 			psTdmaByte4Val = psTdmaByte4Val | 0x1;  /* 0x778 = 0x1 at wifi slot (no blocking BT Low-Pri pkts) */
 
-
 		switch (type) {
 		default:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x1a,
+						    0x1a,
+						    0x0,
+						    psTdmaByte4Val);
 			break;
 		case 1:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist,
-				psTdmaByte0Val,
-				0x3a + nWiFiDurationAdjust,
-				0x03,
-				psTdmaByte3Val,
-				psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    psTdmaByte0Val,
+						    0x3a + nWiFiDurationAdjust,
+						    0x03,
+						    psTdmaByte3Val,
+						    psTdmaByte4Val);
 			break;
 		case 2:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist,
-				psTdmaByte0Val,
-				0x2d + nWiFiDurationAdjust,
-				0x03,
-				psTdmaByte3Val,
-				psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    psTdmaByte0Val,
+						    0x2d + nWiFiDurationAdjust,
+						    0x03,
+						    psTdmaByte3Val,
+						    psTdmaByte4Val);
 			break;
 		case 3:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x1d,
+						    0x1d,
+						    0x0,
+						    0x10);
 			break;
 		case 4:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x93,
+						    0x15,
+						    0x3,
+						    0x14,
+						    0x0);
 			break;
 		case 5:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x15,
+						    0x3,
+						    0x11,
+						    0x10);
 			break;
 		case 6:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x20,
+						    0x3,
+						    0x11,
+						    0x11);
 			break;
 		case 7:
-			halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x13,
+						    0xc,
+						    0x5,
+						    0x0,
+						    0x0);
 			break;
 		case 8:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x93,
+						    0x25,
+						    0x3,
+						    0x10,
+						    0x0);
 			break;
 		case 9:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist,
-				psTdmaByte0Val,
-				0x21,
-				0x3,
-				psTdmaByte3Val,
-				psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    psTdmaByte0Val,
+						    0x21,
+						    0x3,
+						    psTdmaByte3Val,
+						    psTdmaByte4Val);
 			break;
 		case 10:
-			halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x13,
+						    0xa,
+						    0xa,
+						    0x0,
+						    0x40);
 			break;
 		case 11:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist,
-				psTdmaByte0Val,
-				0x21,
-				0x03,
-				psTdmaByte3Val,
-				psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    psTdmaByte0Val,
+						    0x21,
+						    0x03,
+						    psTdmaByte3Val,
+						    psTdmaByte4Val);
 			break;
 		case 12:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x0a,
+						    0x0a,
+						    0x0,
+						    0x50);
 			break;
 		case 13:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x12,
+						    0x12,
+						    0x0,
+						    0x10);
 			break;
 		case 14:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x21,
+						    0x3,
+						    0x10,
+						    psTdmaByte4Val);
 			break;
 		case 15:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x13,
+						    0xa,
+						    0x3,
+						    0x8,
+						    0x0);
 			break;
 		case 16:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x93,
+						    0x15,
+						    0x3,
+						    0x10,
+						    0x0);
 			break;
 		case 18:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x93,
+						    0x25,
+						    0x3,
+						    0x10,
+						    0x0);
 			break;
 		case 20:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10
-
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x3f,
+						    0x03,
+						    0x11,
+						    0x10);
 			break;
 		case 21:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x25,
+						    0x03,
+						    0x11,
+						    0x11);
 			break;
 		case 22:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x25,
+						    0x03,
+						    0x11,
+						    0x10);
 			break;
 		case 23:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xe3,
+						    0x25,
+						    0x3,
+						    0x31,
+						    0x18);
 			break;
 		case 24:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xe3,
+						    0x15,
+						    0x3,
+						    0x31,
+						    0x18);
 			break;
 		case 25:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xe3,
+						    0xa,
+						    0x3,
+						    0x31,
+						    0x18);
 			break;
 		case 26:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xe3,
+						    0xa,
+						    0x3,
+						    0x31,
+						    0x18);
 			break;
 		case 27:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xe3,
+						    0x25,
+						    0x3,
+						    0x31,
+						    0x98);
 			break;
 		case 28:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x69,
+						    0x25,
+						    0x3,
+						    0x31,
+						    0x0);
 			break;
 		case 29:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xab,
+						    0x1a,
+						    0x1a,
+						    0x1,
+						    0x10);
 			break;
 		case 30:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x51,
+						    0x30,
+						    0x3,
+						    0x10,
+						    0x10);
 			break;
 		case 31:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xd3,
+						    0x1a,
+						    0x1a,
+						    0x0,
+						    0x58);
 			break;
 		case 32:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x61,
+						    0x35,
+						    0x3,
+						    0x11,
+						    0x11);
 			break;
 		case 33:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xa3,
+						    0x25,
+						    0x3,
+						    0x30,
+						    0x90);
 			break;
 		case 34:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x53,
+						    0x1a,
+						    0x1a,
+						    0x0,
+						    0x10);
 			break;
 		case 35:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x63,
+						    0x1a,
+						    0x1a,
+						    0x0,
+						    0x10);
 			break;
 		case 36:
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0xd3,
+						    0x12,
+						    0x3,
+						    0x14,
+						    0x50);
 			break;
 		case 40: /*  SoftAP only with no sta associated, BT disable , TDMA mode for power saving */
 			/* here softap mode screen off will cost 70-80mA for phone */
-			halbtc8723b1ant_SetFwPstdma(
-				pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24
-			);
+			halbtc8723b1ant_SetFwPstdma(pBtCoexist,
+						    0x23,
+						    0x18,
+						    0x00,
+						    0x10,
+						    0x24);
 			break;
 		}
 	} else {
@@ -1269,30 +1336,33 @@ static void halbtc8723b1ant_PsTdma(
 		switch (type) {
 		case 8: /* PTA Control */
 			halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0);
-			halbtc8723b1ant_SetAntPath(
-				pBtCoexist, BTC_ANT_PATH_PTA, false, false
-			);
+			halbtc8723b1ant_SetAntPath(pBtCoexist,
+						   BTC_ANT_PATH_PTA,
+						   false,
+						   false);
 			break;
 		case 0:
 		default:  /* Software control, Antenna at BT side */
 			halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
-			halbtc8723b1ant_SetAntPath(
-				pBtCoexist, BTC_ANT_PATH_BT, false, false
-			);
+			halbtc8723b1ant_SetAntPath(pBtCoexist,
+						   BTC_ANT_PATH_BT,
+						   false,
+						   false);
 			break;
 		case 9:   /* Software control, Antenna at WiFi side */
 			halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
-			halbtc8723b1ant_SetAntPath(
-				pBtCoexist, BTC_ANT_PATH_WIFI, false, false
-			);
+			halbtc8723b1ant_SetAntPath(pBtCoexist,
+						   BTC_ANT_PATH_WIFI,
+						   false,
+						   false);
 			break;
 		}
 	}
 
 	rssiAdjustVal = 0;
-	pBtCoexist->fBtcSet(
-		pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
-	);
+	pBtCoexist->fBtcSet(pBtCoexist,
+			    BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
+			    &rssiAdjustVal);
 
 	/*  update pre state */
 	pCoexDm->bPrePsTdmaOn = pCoexDm->bCurPsTdmaOn;
@@ -1306,38 +1376,32 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist)
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
 	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
 
-	if (
-		!bWifiConnected &&
-		pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
-	) {
+	if (!bWifiConnected &&
+	    pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) {
 		/* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
 
 		bCommon = true;
-	} else if (
-		bWifiConnected &&
-		(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)
-	) {
+	} else if (bWifiConnected &&
+		   (pCoexDm->btStatus ==
+		    BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)) {
 		/* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
 
 		bCommon = true;
-	} else if (
-		!bWifiConnected &&
-		(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
-	) {
+	} else if (!bWifiConnected &&
+		   (pCoexDm->btStatus ==
+		    BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)) {
 		/* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
 
 		bCommon = true;
-	} else if (
-		bWifiConnected &&
-		(pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
-	) {
+	} else if (bWifiConnected &&
+		   (pCoexDm->btStatus ==
+		    BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)) {
 		/* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
 
 		bCommon = true;
-	} else if (
-		!bWifiConnected &&
-		(pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
-	) {
+	} else if (!bWifiConnected &&
+		   (pCoexDm->btStatus !=
+		    BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)) {
 		/* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
 
 		bCommon = true;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] staging: rtl8723bs: fix checkpatch warnings
@ 2021-03-13 15:29 hygoni
  2021-03-13 15:32 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: hygoni @ 2021-03-13 15:29 UTC (permalink / raw)
  To: devel; +Cc: hygoni

Fix checkpatch warnings of core/rtw_cmd.c
in detail, unnecessary braces, space before tab and wrongly formatted comments.
Issues found by checkpatch
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 105 +++++++++++------------
 1 file changed, 50 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index 3fe79169a811..9ed1e83769b8 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -158,11 +158,9 @@ static struct cmd_hdl wlancmds[] = {
 	GEN_MLME_EXT_HANDLER(sizeof(struct RunInThread_param), run_in_thread_hdl) /*63*/
 };
 
-/*
-Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
-No irqsave is necessary.
-*/
-
+/* Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
+ * No irqsave is necessary.
+ */
 int rtw_init_cmd_priv(struct	cmd_priv *pcmdpriv)
 {
 	int res = 0;
@@ -229,6 +227,7 @@ void _rtw_free_evt_priv(struct	evt_priv *pevtpriv)
 
 	while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) {
 		void *c2h = rtw_cbuf_pop(pevtpriv->c2h_queue);
+
 		if (c2h && c2h != (void *)pevtpriv)
 			kfree(c2h);
 	}
@@ -248,15 +247,14 @@ void _rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv)
 	}
 }
 
-/*
-Calling Context:
-
-rtw_enqueue_cmd can only be called between kernel thread,
-since only spin_lock is used.
-
-ISR/Call-Back functions can't call this sub-function.
-
-*/
+/* Calling Context:
+ *
+ * rtw_enqueue_cmd can only be called between kernel thread,
+ * since only spin_lock is used.
+ *
+ * ISR/Call-Back functions can't call this sub-function.
+ *
+ */
 
 int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
 {
@@ -321,9 +319,9 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 		|| atomic_read(&(pcmdpriv->cmdthd_running)) == false	/* com_thread not running */
 	) {
 		/* DBG_871X("%s:%s: drop cmdcode:%u, hw_init_completed:%u, cmdthd_running:%u\n", caller_func, __func__, */
-		/* 	cmd_obj->cmdcode, */
-		/* 	pcmdpriv->padapter->hw_init_completed, */
-		/* 	pcmdpriv->cmdthd_running */
+		/*	cmd_obj->cmdcode, */
+		/*	pcmdpriv->padapter->hw_init_completed, */
+		/*	pcmdpriv->cmdthd_running */
 		/*  */
 
 		return _FAIL;
@@ -554,18 +552,17 @@ int rtw_cmd_thread(void *context)
 	thread_exit();
 }
 
-/*
-rtw_sitesurvey_cmd(~)
-	### NOTE:#### (!!!!)
-	MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
-*/
+/* rtw_sitesurvey_cmd(~)
+ * ### NOTE:#### (!!!!)
+ * MUST TAKE CARE THAT BEFORE CALLING THIS FUNC, YOU SHOULD HAVE LOCKED pmlmepriv->lock
+ */
 u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid, int ssid_num,
 	struct rtw_ieee80211_channel *ch, int ch_num)
 {
 	u8 res = _FAIL;
 	struct cmd_obj		*ph2c;
 	struct sitesurvey_parm	*psurveyPara;
-	struct cmd_priv 	*pcmdpriv = &padapter->cmdpriv;
+	struct cmd_priv		*pcmdpriv = &padapter->cmdpriv;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
@@ -593,6 +590,7 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
 	/* prepare ssid list */
 	if (ssid) {
 		int i;
+
 		for (i = 0; i < ssid_num && i < RTW_SSID_SCAN_AMOUNT; i++) {
 			if (ssid[i].SsidLength) {
 				memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
@@ -607,6 +605,7 @@ u8 rtw_sitesurvey_cmd(struct adapter  *padapter, struct ndis_802_11_ssid *ssid,
 	/* prepare channel list */
 	if (ch) {
 		int i;
+
 		for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
 			if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
 				memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
@@ -671,16 +670,15 @@ void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter,  struct cmd_obj *p
 u8 rtw_createbss_cmd(struct adapter  *padapter)
 {
 	struct cmd_obj *pcmd;
-	struct cmd_priv 			*pcmdpriv = &padapter->cmdpriv;
-	struct mlme_priv 		*pmlmepriv = &padapter->mlmepriv;
+	struct cmd_priv				*pcmdpriv = &padapter->cmdpriv;
+	struct mlme_priv		*pmlmepriv = &padapter->mlmepriv;
 	struct wlan_bssid_ex		*pdev_network = &padapter->registrypriv.dev_network;
 	u8 res = _SUCCESS;
 
-	if (pmlmepriv->assoc_ssid.SsidLength == 0) {
+	if (pmlmepriv->assoc_ssid.SsidLength == 0)
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for Any SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
-	} else {
+	else
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, (" createbss for SSid:%s\n", pmlmepriv->assoc_ssid.Ssid));
-	}
 
 	pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
 	if (pcmd == NULL) {
@@ -755,23 +753,22 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 	uint	t_len = 0;
 	struct wlan_bssid_ex		*psecnetwork;
 	struct cmd_obj		*pcmd;
-	struct cmd_priv 	*pcmdpriv = &padapter->cmdpriv;
-	struct mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
-	struct qos_priv 	*pqospriv = &pmlmepriv->qospriv;
+	struct cmd_priv		*pcmdpriv = &padapter->cmdpriv;
+	struct mlme_priv	*pmlmepriv = &padapter->mlmepriv;
+	struct qos_priv		*pqospriv = &pmlmepriv->qospriv;
 	struct security_priv *psecuritypriv = &padapter->securitypriv;
 	struct registry_priv *pregistrypriv = &padapter->registrypriv;
-	struct ht_priv 		*phtpriv = &pmlmepriv->htpriv;
+	struct ht_priv		*phtpriv = &pmlmepriv->htpriv;
 	enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->network.InfrastructureMode;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 	struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
 	u32 tmp_len;
 	u8 *ptmp = NULL;
 
-	if (pmlmepriv->assoc_ssid.SsidLength == 0) {
+	if (pmlmepriv->assoc_ssid.SsidLength == 0)
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_info_, ("+Join cmd: Any SSid\n"));
-	} else {
+	else
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_notice_, ("+Join cmd: SSid =[%s]\n", pmlmepriv->assoc_ssid.Ssid));
-	}
 
 	pcmd = rtw_zmalloc(sizeof(struct cmd_obj));
 	if (pcmd == NULL) {
@@ -810,11 +807,10 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 
 	psecuritypriv->authenticator_ie[0] = (unsigned char)psecnetwork->IELength;
 
-	if ((psecnetwork->IELength-12) < (256-1)) {
+	if ((psecnetwork->IELength-12) < (256-1))
 		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], psecnetwork->IELength-12);
-	} else {
+	else
 		memcpy(&psecuritypriv->authenticator_ie[1], &psecnetwork->IEs[12], (256-1));
-	}
 
 	psecnetwork->IELength = 0;
 	/*  Added by Albert 2009/02/18 */
@@ -844,9 +840,9 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
 	phtpriv->ht_option = false;
 	ptmp = rtw_get_ie(&pnetwork->network.IEs[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.IELength-12);
 	if (pregistrypriv->ht_enable && ptmp && tmp_len > 0) {
-		/* 	Added by Albert 2010/06/23 */
-		/* 	For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
-		/* 	Especially for Realtek 8192u SoftAP. */
+		/*	Added by Albert 2010/06/23 */
+		/*	For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
+		/*	Especially for Realtek 8192u SoftAP. */
 		if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
 			(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
 			(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
@@ -955,11 +951,11 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
 {
 	struct cmd_obj *ph2c;
 	struct set_stakey_parm	*psetstakey_para;
-	struct cmd_priv 			*pcmdpriv = &padapter->cmdpriv;
+	struct cmd_priv				*pcmdpriv = &padapter->cmdpriv;
 	struct set_stakey_rsp		*psetstakey_rsp = NULL;
 
-	struct mlme_priv 		*pmlmepriv = &padapter->mlmepriv;
-	struct security_priv 	*psecuritypriv = &padapter->securitypriv;
+	struct mlme_priv		*pmlmepriv = &padapter->mlmepriv;
+	struct security_priv	*psecuritypriv = &padapter->securitypriv;
 	u8 res = _SUCCESS;
 
 	psetstakey_para = rtw_zmalloc(sizeof(struct set_stakey_parm));
@@ -970,17 +966,15 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
 
 	memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
+	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
 		psetstakey_para->algorithm = (unsigned char) psecuritypriv->dot11PrivacyAlgrthm;
-	} else {
+	else
 		GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
-	}
 
-	if (unicast_key == true) {
+	if (unicast_key == true)
 		memcpy(&psetstakey_para->key, &sta->dot118021x_UncstKey, 16);
-	} else {
+	else
 		memcpy(&psetstakey_para->key, &psecuritypriv->dot118021XGrpKey[psecuritypriv->dot118021XGrpKeyid].skey, 16);
-	}
 
 	/* jeff: set this because at least sw key is ready */
 	padapter->securitypriv.busetkipkey = true;
@@ -1017,7 +1011,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu
 {
 	struct cmd_obj *ph2c;
 	struct set_stakey_parm	*psetstakey_para;
-	struct cmd_priv 			*pcmdpriv = &padapter->cmdpriv;
+	struct cmd_priv				*pcmdpriv = &padapter->cmdpriv;
 	struct set_stakey_rsp		*psetstakey_rsp = NULL;
 	s16 cam_id = 0;
 	u8 res = _SUCCESS;
@@ -1068,7 +1062,7 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu
 
 u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
 {
-	struct cmd_priv 	*pcmdpriv = &padapter->cmdpriv;
+	struct cmd_priv		*pcmdpriv = &padapter->cmdpriv;
 	struct cmd_obj *ph2c;
 	struct addBaReq_parm	*paddbareq_parm;
 
@@ -1296,7 +1290,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 	u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
 	u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
 
-	struct mlme_priv 	*pmlmepriv = &(padapter->mlmepriv);
+	struct mlme_priv	*pmlmepriv = &(padapter->mlmepriv);
 
 	collect_traffic_statistics(padapter);
 
@@ -1397,6 +1391,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 static void dynamic_chk_wk_hdl(struct adapter *padapter)
 {
 	struct mlme_priv *pmlmepriv;
+
 	pmlmepriv = &(padapter->mlmepriv);
 
 	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
@@ -1495,7 +1490,7 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue)
 	u8 res = _SUCCESS;
 
 	/* if (!pwrctrlpriv->bLeisurePs) */
-	/* 	return res; */
+	/*	return res; */
 
 	if (enqueue) {
 		ph2c = rtw_zmalloc(sizeof(struct cmd_obj));
@@ -2035,7 +2030,7 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd)
 	if (pcmd->parmbuf == NULL)
 		goto exit;
 
-	if ((pcmd->res != H2C_SUCCESS)) {
+	if (pcmd->res != H2C_SUCCESS) {
 		RT_TRACE(_module_rtl871x_cmd_c_, _drv_err_, ("\n ********Error: rtw_createbss_cmd_callback  Fail ************\n\n."));
 		_set_timer(&pmlmepriv->assoc_timer, 1);
 	}
-- 
2.24.3 (Apple Git-128)

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2022-03-23 11:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-23 11:38 [PATCH] staging: rtl8723bs: Fix checkpatch warnings Sathish Kumar
2022-03-23 11:55 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2021-03-13 15:29 [PATCH] staging: rtl8723bs: fix " hygoni
2021-03-13 15:32 ` Greg KH

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.