From: Michael Harris <michaelharriscode@gmail.com>
To: gregkh@linuxfoundation.org
Cc: hdegoede@redhat.com, Larry.Finger@lwfinger.net,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH] Staging: rtl8723bs: hal_btcoex: fixed styling issues
Date: Tue, 27 Feb 2024 00:09:43 -0800 [thread overview]
Message-ID: <20240227080943.13032-1-michaelharriscode@gmail.com> (raw)
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@gmail.com>
---
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
next reply other threads:[~2024-02-27 8:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 8:09 Michael Harris [this message]
2024-02-27 8:22 ` [PATCH] Staging: rtl8723bs: hal_btcoex: fixed styling issues Greg KH
2024-02-27 8:54 ` Dan Carpenter
2024-02-27 16:25 ` Michael Harris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240227080943.13032-1-michaelharriscode@gmail.com \
--to=michaelharriscode@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.