Commit 83e9f677 authored by Desmond Cheong Zhi Xi's avatar Desmond Cheong Zhi Xi Committed by Greg Kroah-Hartman
Browse files

Staging: rtl8723bs: remove unnecessary braces in HalBtc8723b1Ant.c



This commit fixes the following checkpatch.pl warnings:

WARNING: braces {} are not necessary for any arm of this statement
+			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+			} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+			if (btRssi < rssiThresh) {
[...]
+			} else {
[...]

WARNING: braces {} are not necessary for single statement blocks
+		if (rssiThresh > rssiThresh1) {
+			return pCoexSta->preBtRssiState;
+		}

WARNING: braces {} are not necessary for any arm of this statement
+			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+			} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+			if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
[...]
+			} else if (btRssi < rssiThresh) {
[...]
+			} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+			if (btRssi < rssiThresh1) {
[...]
+			} else {
[...]

WARNING: braces {} are not necessary for single statement blocks
+	if (!pBtLinkInfo->bBtLinkExist) {
+		return algorithm;
+	}

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (bBtHsOn) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for any arm of this statement
+				if (u1Tmp & BIT0) {
[...]
+				} else {
[...]

WARNING: braces {} are not necessary for single statement blocks
+	if (pBtCoexist->bManualControl) {
+		return;
+	}

WARNING: braces {} are not necessary for single statement blocks
+	if (pBtCoexist->bStopCoexDm) {
+		return;
+	}

WARNING: braces {} are not necessary for single statement blocks
+	if (pCoexSta->bUnderIps) {
+		return;
+	}

WARNING: braces {} are not necessary for any arm of this statement
+		if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) {
[...]
+		} else
[...]

WARNING: braces {} are not necessary for any arm of this statement
+	if (BTC_LPS_ENABLE == type) {
[...]
+	} else if (BTC_LPS_DISABLE == type) {
[...]

WARNING: braces {} are not necessary for single statement blocks
+			if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) {
+				halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
+			}

Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDesmond Cheong Zhi Xi <desmondcheongzx@gmail.com>
Link: https://lore.kernel.org/r/20210518044119.2960494-2-desmondcheongzx@gmail.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 509af4f9
Loading
Loading
Loading
Loading
+37 −57
Original line number Diff line number Diff line
@@ -38,52 +38,46 @@ static u8 halbtc8723b1ant_BtRssiState(
			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
		) {
			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))

				btRssiState = BTC_RSSI_STATE_HIGH;
			} else {
			else
				btRssiState = BTC_RSSI_STATE_STAY_LOW;
			}
		} else {
			if (btRssi < rssiThresh) {
			if (btRssi < rssiThresh)
				btRssiState = BTC_RSSI_STATE_LOW;
			} else {
			else
				btRssiState = BTC_RSSI_STATE_STAY_HIGH;
		}
		}
	} else if (levelNum == 3) {
		if (rssiThresh > rssiThresh1) {
		if (rssiThresh > rssiThresh1)
			return pCoexSta->preBtRssiState;
		}

		if (
			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
			(pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
		) {
			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) {
			if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
				btRssiState = BTC_RSSI_STATE_MEDIUM;
			} else {
			else
				btRssiState = BTC_RSSI_STATE_STAY_LOW;
			}
		} 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)) {
			if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
				btRssiState = BTC_RSSI_STATE_HIGH;
			} else if (btRssi < rssiThresh) {
			else if (btRssi < rssiThresh)
				btRssiState = BTC_RSSI_STATE_LOW;
			} else {
			else
				btRssiState = BTC_RSSI_STATE_STAY_MEDIUM;
			}
		} else {
			if (btRssi < rssiThresh1) {
			if (btRssi < rssiThresh1)
				btRssiState = BTC_RSSI_STATE_MEDIUM;
			} else {
			else
				btRssiState = BTC_RSSI_STATE_STAY_HIGH;
		}
	}
	}

	pCoexSta->preBtRssiState = btRssiState;

@@ -508,9 +502,8 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)

	pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);

	if (!pBtLinkInfo->bBtLinkExist) {
	if (!pBtLinkInfo->bBtLinkExist)
		return algorithm;
	}

	if (pBtLinkInfo->bScoExist)
		numOfDiffProfile++;
@@ -530,13 +523,12 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
			} else if (pBtLinkInfo->bA2dpExist) {
				algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP;
			} else if (pBtLinkInfo->bPanExist) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANHS;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR;
			}
		}
		}
	} else if (numOfDiffProfile == 2) {
		if (pBtLinkInfo->bScoExist) {
			if (pBtLinkInfo->bHidExist) {
@@ -544,29 +536,26 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
			} else if (pBtLinkInfo->bA2dpExist) {
				algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
			} else if (pBtLinkInfo->bPanExist) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
			}
			}
		} else {
			if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) {
				algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
			} else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
				}
			} else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP;
			}
		}
		}
	} else if (numOfDiffProfile == 3) {
		if (pBtLinkInfo->bScoExist) {
			if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) {
@@ -574,31 +563,28 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
			} else if (
				pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist
			) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
				}
			} else if (pBtLinkInfo->bPanExist && pBtLinkInfo->bA2dpExist) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_SCO;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
			}
			}
		} else {
			if (
				pBtLinkInfo->bHidExist &&
				pBtLinkInfo->bPanExist &&
				pBtLinkInfo->bA2dpExist
			) {
				if (bBtHsOn) {
				if (bBtHsOn)
					algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
				} else {
				else
					algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR;
			}
		}
		}
	} else if (numOfDiffProfile >= 3) {
		if (pBtLinkInfo->bScoExist) {
			if (
@@ -893,12 +879,11 @@ static void halbtc8723b1ant_SetAntPath(
				u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d);
				cntBtCalChk++;

				if (u1Tmp & BIT0) {
				if (u1Tmp & BIT0)
					mdelay(50);
				} else {
				else
					break;
			}
			}

			/*  set grant_bt to PTA */
			pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0);
@@ -2015,17 +2000,14 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
	u32 wifiLinkStatus = 0;
	u32 numOfWifiLink = 0;

	if (pBtCoexist->bManualControl) {
	if (pBtCoexist->bManualControl)
		return;
	}

	if (pBtCoexist->bStopCoexDm) {
	if (pBtCoexist->bStopCoexDm)
		return;
	}

	if (pCoexSta->bUnderIps) {
	if (pCoexSta->bUnderIps)
		return;
	}

	if (
		(BT_8723B_1ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) ||
@@ -2057,9 +2039,9 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
		halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
		halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize);

		if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) {
		if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage))
			halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
		} else
		else
			halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);

		return;
@@ -2718,12 +2700,11 @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
	if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm)
		return;

	if (BTC_LPS_ENABLE == type) {
	if (BTC_LPS_ENABLE == type)
		pCoexSta->bUnderLps = true;
	} else if (BTC_LPS_DISABLE == type) {
	else if (BTC_LPS_DISABLE == type)
		pCoexSta->bUnderLps = false;
}
}

void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)
{
@@ -3029,9 +3010,8 @@ void EXhalbtc8723b1ant_BtInfoNotify(
		}

		if (pCoexSta->btInfoExt & BIT3) {
			if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) {
			if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm)
				halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
			}
		} else {
			/*  BT already NOT ignore Wlan active, do nothing here. */
		}