Fixed various checkpatch.pl styling issues: spaces before tabs, constants being on left side of comparisons, unnecessary braces, etc. Signed-off-by: Michael Harris <michaelharriscode@xxxxxxxxx> --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 78 +++++++++++----------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index e26b789b9cdd..91922457e6e8 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -10,14 +10,14 @@ #include <hal_btcoex.h> #include <Mp_Precomp.h> -/* Global variables */ +/* Global variables */ struct btc_coexist GLBtCoexist; static u8 GLBtcWiFiInScanState; static u8 GLBtcWiFiInIQKState; /* */ -/* Debug related function */ +/* Debug related function */ /* */ static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist) { @@ -92,7 +92,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) stime = jiffies; do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); - if (_SUCCESS == ready) + if (ready == _SUCCESS) break; utime = jiffies_to_msecs(jiffies - stime); @@ -304,8 +304,10 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) break; case BTC_GET_BL_WIFI_SCAN: - /* Use the value of the new variable GLBtcWiFiInScanState to judge whether WiFi is in scan state or not, since the originally used flag - WIFI_SITE_MONITOR in fwstate may not be cleared in time */ + /* + * Use the value of the new variable GLBtcWiFiInScanState to judge whether WiFi is in scan state or not, since the originally used flag + * WIFI_SITE_MONITOR in fwstate may not be cleared in time + */ *pu8 = GLBtcWiFiInScanState; break; @@ -365,6 +367,7 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) case BTC_GET_U4_WIFI_TRAFFIC_DIRECTION: { struct rt_link_detect_t *plinkinfo; + plinkinfo = &padapter->mlmepriv.LinkDetectInfo; if (plinkinfo->NumTxOkInPeriod > plinkinfo->NumRxOkInPeriod) @@ -402,9 +405,9 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) case BTC_GET_U1_MAC_PHY_MODE: *pu8 = BTC_SMSP; -/* *pU1Tmp = BTC_DMSP; */ -/* *pU1Tmp = BTC_DMDP; */ -/* *pU1Tmp = BTC_MP_UNKNOWN; */ +/* *pU1Tmp = BTC_DMSP; */ +/* *pU1Tmp = BTC_DMDP; */ +/* *pU1Tmp = BTC_MP_UNKNOWN; */ break; case BTC_GET_U1_AP_NUM: @@ -562,7 +565,7 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) } /* */ -/* IO related function */ +/* IO related function */ /* */ static u8 halbtcoutsrc_Read1Byte(void *pBtcContext, u32 RegAddr) { @@ -669,7 +672,7 @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; struct adapter *Adapter = pBtCoexist->Adapter; - if (BTC_INTF_SDIO == pBtCoexist->chipInterface) + if (pBtCoexist->chipInterface == BTC_INTF_SDIO) rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); else rtw_write8(Adapter, RegAddr, Data); @@ -773,7 +776,7 @@ static void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, } /* */ -/* Extern functions called by other module */ +/* Extern functions called by other module */ /* */ static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter) { @@ -781,8 +784,8 @@ static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter) if (pBtCoexist->bBinded) return false; - else - pBtCoexist->bBinded = true; + + pBtCoexist->bBinded = true; pBtCoexist->statistics.cntBind++; @@ -895,20 +898,20 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (IPS_NONE == type) + if (type == IPS_NONE) ipsType = BTC_IPS_LEAVE; else ipsType = BTC_IPS_ENTER; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_IpsNotify(pBtCoexist, ipsType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_IpsNotify(pBtCoexist, ipsType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) @@ -923,7 +926,7 @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (PS_MODE_ACTIVE == type) + if (type == PS_MODE_ACTIVE) lpsType = BTC_LPS_DISABLE; else lpsType = BTC_LPS_ENABLE; @@ -953,14 +956,14 @@ void EXhalbtcoutsrc_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) } /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_ScanNotify(pBtCoexist, scanType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_ScanNotify(pBtCoexist, scanType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) @@ -979,14 +982,14 @@ void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) assoType = BTC_ASSOCIATE_FINISH; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_ConnectNotify(pBtCoexist, assoType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_ConnectNotify(pBtCoexist, assoType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum @@ -1001,20 +1004,20 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum if (pBtCoexist->bManualControl) return; - if (RT_MEDIA_CONNECT == mediaStatus) + if (mediaStatus == RT_MEDIA_CONNECT) mStatus = BTC_MEDIA_CONNECT; else mStatus = BTC_MEDIA_DISCONNECT; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, mStatus); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, mStatus); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktType) @@ -1027,25 +1030,24 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy if (pBtCoexist->bManualControl) return; - if (PACKET_DHCP == pktType) { + if (pktType == PACKET_DHCP) packetType = BTC_PACKET_DHCP; - } else if (PACKET_EAPOL == pktType) { + else if (pktType == PACKET_EAPOL) packetType = BTC_PACKET_EAPOL; - } else if (PACKET_ARP == pktType) { + else if (pktType == PACKET_ARP) packetType = BTC_PACKET_ARP; - } else { + else return; - } /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_SpecialPacketNotify(pBtCoexist, packetType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_SpecialPacketNotify(pBtCoexist, packetType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length) @@ -1056,14 +1058,14 @@ void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 pBtCoexist->statistics.cntBtInfoNotify++; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_BtInfoNotify(pBtCoexist, tmpBuf, length); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_BtInfoNotify(pBtCoexist, tmpBuf, length); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_HaltNotify(struct btc_coexist *pBtCoexist) @@ -1103,25 +1105,25 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) /* Periodical should be called in cmd thread, */ /* don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ +/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_Periodical(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_Periodical(pBtCoexist); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ +/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) { - if (BT_COEX_ANT_TYPE_PG == type) { + if (type == BT_COEX_ANT_TYPE_PG) { GLBtCoexist.boardInfo.pgAntNum = antNum; GLBtCoexist.boardInfo.btdmAntNum = antNum; - } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { + } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ - } else if (BT_COEX_ANT_TYPE_DETECTED == type) { + } else if (type == BT_COEX_ANT_TYPE_DETECTED) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } -- 2.43.2