2020-11-10 04:14:00

by Ross Schmidt

[permalink] [raw]
Subject: [PATCH 01/10] staging: rtl8723bs: clean up line spacing

Add or remove lines to fix coding style issues and clear checkpatch.

WARNING: Missing a blank line after declarations
CHECK: Please use a blank line after function/struct/union/enum declarations
CHECK: Please don't use multiple blank lines

Signed-off-by: Ross Schmidt <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_security.c | 29 ++++---------------
drivers/staging/rtl8723bs/core/rtw_sta_mgt.c | 7 +----
.../staging/rtl8723bs/core/rtw_wlan_util.c | 12 +++++++-
drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 ++
4 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index 81c15895f646..894e7beae96f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -1008,7 +1008,6 @@ static void shift_row(u8 *in, u8 *out)
out[15] = in[11];
}

-
static void mix_column(u8 *in, u8 *out)
{
sint i;
@@ -1098,7 +1097,6 @@ static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext)
}
}

-
/************************************************/
/* construct_mic_iv() */
/* Builds the MIC IV from header fields and PN */
@@ -1145,7 +1143,6 @@ static void construct_mic_iv(
mic_iv[15] = (unsigned char) (payload_length % 256);
}

-
/************************************************/
/* construct_mic_header1() */
/* Builds the first MIC header block from */
@@ -1183,7 +1180,6 @@ static void construct_mic_header1(
mic_header1[15] = mpdu[15];
}

-
/************************************************/
/* construct_mic_header2() */
/* Builds the last MIC header block from */
@@ -1211,7 +1207,6 @@ static void construct_mic_header2(
mic_header2[6] = 0x00;
mic_header2[7] = 0x00; /* mpdu[23]; */

-
if (!qc_exists && a4_exists) {
for (i = 0; i < 6; i++)
mic_header2[8+i] = mpdu[24+i]; /* A4 */
@@ -1277,7 +1272,6 @@ static void construct_ctr_preload(
ctr_preload[15] = (unsigned char) (c % 256);
}

-
/************************************/
/* bitwise_xor() */
/* A 128 bit, bitwise exclusive or */
@@ -1291,7 +1285,6 @@ static void bitwise_xor(u8 *ina, u8 *inb, u8 *out)
}
}

-
static sint aes_cipher(u8 *key, uint hdrlen,
u8 *pframe, uint plen)
{
@@ -1314,7 +1307,6 @@ static sint aes_cipher(u8 *key, uint hdrlen,

frsubtype = frsubtype>>4;

-
memset((void *)mic_iv, 0, 16);
memset((void *)mic_header1, 0, 16);
memset((void *)mic_header2, 0, 16);
@@ -1377,7 +1369,6 @@ static sint aes_cipher(u8 *key, uint hdrlen,
qc_exists
);

-
payload_remainder = plen % 16;
num_blocks = plen / 16;

@@ -1484,7 +1475,6 @@ static sint aes_cipher(u8 *key, uint hdrlen,
u32 rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
{ /* exclude ICV */

-
/*static*/
/* unsigned char message[MAX_MSG_SIZE]; */

@@ -1551,13 +1541,11 @@ static sint aes_decipher(u8 *key, uint hdrlen,
u8 padded_buffer[16];
u8 mic[8];

-
uint frtype = GetFrameType(pframe);
uint frsubtype = GetFrameSubType(pframe);

frsubtype = frsubtype>>4;

-
memset((void *)mic_iv, 0, 16);
memset((void *)mic_header1, 0, 16);
memset((void *)mic_header2, 0, 16);
@@ -1603,7 +1591,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
} else
qc_exists = 0;

-
/* now, decrypt pframe with hdrlen offset and plen long */

payload_index = hdrlen + 8; /* 8 is for extiv */
@@ -1649,7 +1636,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
if ((hdrlen + plen+8) <= MAX_MSG_SIZE)
memcpy((void *)message, pframe, (hdrlen + plen+8)); /* 8 is for ext iv len */

-
pn_vector[0] = pframe[hdrlen];
pn_vector[1] = pframe[hdrlen+1];
pn_vector[2] = pframe[hdrlen+4];
@@ -1657,8 +1643,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
pn_vector[4] = pframe[hdrlen+6];
pn_vector[5] = pframe[hdrlen+7];

-
-
construct_mic_iv(
mic_iv,
qc_exists,
@@ -1682,7 +1666,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
qc_exists
);

-
payload_remainder = (plen-8) % 16;
num_blocks = (plen-8) / 16;

@@ -1808,14 +1791,11 @@ static sint aes_decipher(u8 *key, uint hdrlen,
u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
{ /* exclude ICV */

-
/*static*/
/* unsigned char message[MAX_MSG_SIZE]; */

-
/* Intermediate Buffers */

-
sint length;
u8 *pframe, *prwskey; /* *payload,*iv */
struct sta_info *stainfo;
@@ -1879,7 +1859,6 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
} else
prwskey = &stainfo->dot118021x_UncstKey.skey[0];

-
length = ((union recv_frame *)precvframe)->u.hdr.len-prxattrib->hdrlen-prxattrib->iv_len;

res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);
@@ -2040,6 +2019,7 @@ const u32 Te0[256] = {
0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
};
+
const u32 Td0[256] = {
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
@@ -2106,6 +2086,7 @@ const u32 Td0[256] = {
0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
};
+
const u8 Td4s[256] = {
0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U,
0xbfU, 0x40U, 0xa3U, 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU,
@@ -2140,6 +2121,7 @@ const u8 Td4s[256] = {
0x17U, 0x2bU, 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U,
0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, 0x21U, 0x0cU, 0x7dU,
};
+
const u8 rcons[] = {
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36
/* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
@@ -2221,6 +2203,7 @@ d##3 = TE0(s##3) ^ TE1(s##0) ^ TE2(s##1) ^ TE3(s##2) ^ rk[4 * i + 3]
static void *aes_encrypt_init(u8 *key, size_t len)
{
u32 *rk;
+
if (len != 16)
return NULL;
rk = rtw_malloc(AES_PRIV_SIZE);
@@ -2235,7 +2218,6 @@ static void aes_128_encrypt(void *ctx, u8 *plain, u8 *crypt)
rijndaelEncrypt(ctx, plain, crypt);
}

-
static void gf_mulx(u8 *pad)
{
int i, carry;
@@ -2254,7 +2236,6 @@ static void aes_encrypt_deinit(void *ctx)
kfree_sensitive(ctx);
}

-
/**
* omac1_aes_128_vector - One-Key CBC MAC (OMAC1) hash with AES-128
* @key: 128-bit key for the hash operation
@@ -2328,7 +2309,6 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem,
return 0;
}

-
/**
* omac1_aes_128 - One-Key CBC MAC (OMAC1) hash with AES-128 (aka AES-CMAC)
* @key: 128-bit key for the hash operation
@@ -2371,6 +2351,7 @@ u8 rtw_handle_tkip_countermeasure(struct adapter *adapter, const char *caller)

if (securitypriv->btkip_countermeasure) {
unsigned long passing_ms = jiffies_to_msecs(jiffies - securitypriv->btkip_countermeasure_time);
+
if (passing_ms > 60*1000) {
DBG_871X_LEVEL(_drv_always_, "%s(%s) countermeasure time:%lus > 60s\n",
caller, ADPT_ARG(adapter), passing_ms/1000);
diff --git a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
index dad982ed4ecf..f24ad8b1a400 100644
--- a/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
+++ b/drivers/staging/rtl8723bs/core/rtw_sta_mgt.c
@@ -163,6 +163,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)

while (phead != plist) {
int i;
+
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
plist = get_next(plist);

@@ -282,7 +283,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
rtw_init_recv_timer(preorder_ctrl);
}

-
/* init for DM */
psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
@@ -297,7 +297,6 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)

exit:

-
return psta;
}

@@ -315,14 +314,12 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
if (!psta)
goto exit;

-
spin_lock_bh(&psta->lock);
psta->state &= ~_FW_LINKED;
spin_unlock_bh(&psta->lock);

pfree_sta_queue = &pstapriv->free_sta_queue;

-
pstaxmitpriv = &psta->sta_xmitpriv;

/* list_del_init(&psta->sleep_list); */
@@ -405,7 +402,6 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)

del_timer_sync(&preorder_ctrl->reordering_ctrl_timer);

-
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;

spin_lock_bh(&ppending_recvframe_queue->lock);
@@ -531,7 +527,6 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead);

-
while (phead != plist) {

psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index c9ac5c685d74..f28536fbc4fb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -259,12 +259,14 @@ void UpdateBrateTblForSoftAP(u8 *bssrateset, u32 bssratelen)
void Save_DM_Func_Flag(struct adapter *padapter)
{
u8 bSaveFlag = true;
+
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
}

void Restore_DM_Func_Flag(struct adapter *padapter)
{
u8 bSaveFlag = false;
+
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
}

@@ -304,6 +306,7 @@ inline void rtw_set_oper_ch(struct adapter *adapter, u8 ch)

for (i = 0; i < dvobj->iface_nums; i++) {
struct adapter *iface = dvobj->padapters[i];
+
cnt += scnprintf(msg+cnt, len-cnt, " [%s:", ADPT_ARG(iface));
if (iface->mlmeextpriv.cur_channel == ch)
cnt += scnprintf(msg+cnt, len-cnt, "C");
@@ -420,6 +423,7 @@ inline u8 *get_my_bssid(struct wlan_bssid_ex *pnetwork)
u16 get_beacon_interval(struct wlan_bssid_ex *bss)
{
__le16 val;
+
memcpy((unsigned char *)&val, rtw_get_beacon_interval_from_ie(bss->IEs), 2);

return le16_to_cpu(val);
@@ -493,6 +497,7 @@ void invalidate_cam_all(struct adapter *padapter)
static u32 _ReadCAM(struct adapter *padapter, u32 addr)
{
u32 count = 0, cmd;
+
cmd = CAM_POLLINIG | addr;
rtw_write32(padapter, RWCAM, cmd);

@@ -503,9 +508,11 @@ static u32 _ReadCAM(struct adapter *padapter, u32 addr)

return rtw_read32(padapter, REG_CAMREAD);
}
+
void read_cam(struct adapter *padapter, u8 entry, u8 *get_key)
{
u32 j, addr, cmd;
+
addr = entry << 3;

/* DBG_8192C("********* DUMP CAM Entry_#%02d***************\n", entry); */
@@ -1876,7 +1883,6 @@ void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
/*
DBG_871X("%s(): (a)bcn_cnt = %d\n", __func__, pmlmeext->bcn_cnt);

-
for (i = 0; i<9; i++)
{
DBG_871X("%s():bcn_delay_cnt[%d]=%d, bcn_delay_ratio[%d]=%d\n", __func__, i,
@@ -1980,12 +1986,14 @@ void rtw_release_macid(struct adapter *padapter, struct sta_info *psta)
}
spin_unlock_bh(&pdvobj->lock);
}
+
/* For 8188E RA */
u8 rtw_search_max_mac_id(struct adapter *padapter)
{
u8 max_mac_id = 0;
struct dvobj_priv *pdvobj = adapter_to_dvobj(padapter);
int i;
+
spin_lock_bh(&pdvobj->lock);
for (i = (NUM_STA-1); i >= 0 ; i--) {
if (pdvobj->macid[i] == true)
@@ -2111,6 +2119,7 @@ void rtw_get_current_ip_address(struct adapter *padapter, u8 *pcurrentip)
pmlmeinfo->state & WIFI_FW_AP_STATE) {
if (my_ip_ptr) {
struct in_ifaddr *my_ifa_list = my_ip_ptr->ifa_list;
+
if (my_ifa_list) {
ipaddress[0] = my_ifa_list->ifa_address & 0xFF;
ipaddress[1] = (my_ifa_list->ifa_address >> 8) & 0xFF;
@@ -2149,6 +2158,7 @@ void rtw_get_sec_iv(struct adapter *padapter, u8 *pcur_dot11txpn, u8 *StaAddr)
pcur_dot11txpn[5], pcur_dot11txpn[6], pcur_dot11txpn[7]);
}
}
+
void rtw_set_sec_pn(struct adapter *padapter)
{
struct sta_info *psta;
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index aaafa38c34c4..eba29abfa832 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -398,6 +398,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
/* check HT op mode */
if (pattrib->ht_en) {
u8 HTOpMode = pmlmeinfo->HT_protection;
+
if ((pmlmeext->cur_bwmode && (HTOpMode == 2 || HTOpMode == 3)) ||
(!pmlmeext->cur_bwmode && HTOpMode == 3)) {
pattrib->vcs_mode = RTS_CTS;
@@ -1003,6 +1004,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
/* Update Seq Num will be handled by f/w */
{
struct sta_info *psta;
+
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
if (pattrib->psta != psta) {
DBG_871X("%s, pattrib->psta(%p) != psta(%p)\n", __func__, pattrib->psta, psta);
@@ -1243,6 +1245,7 @@ s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit
struct ieee80211_hdr *pwlanhdr;
u8 MME[_MME_IE_LENGTH_];
u32 ori_len;
+
mem_start = pframe = (u8 *)(pxmitframe->buf_addr) + TXDESC_OFFSET;
pwlanhdr = (struct ieee80211_hdr *)pframe;

--
2.25.1


2020-11-10 04:14:10

by Ross Schmidt

[permalink] [raw]
Subject: [PATCH 08/10] staging: rtl8723bs: clean up logical continuations

Move operators to fix coding style issues and clear checkpatch checks.

CHECK: Logical continuations should be on the previous line

Signed-off-by: Ross Schmidt <[email protected]>
---
drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 41 +++++++------------
drivers/staging/rtl8723bs/core/rtw_recv.c | 27 ++++++------
.../staging/rtl8723bs/core/rtw_wlan_util.c | 6 +--
drivers/staging/rtl8723bs/core/rtw_xmit.c | 6 +--
4 files changed, 34 insertions(+), 46 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
index 90e222a9c93b..5b05d1eaa328 100644
--- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c
@@ -451,9 +451,8 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
hal_btcoex_LpsNotify(padapter, ps_mode);
}
} else {
- if ((PS_RDY_CHECK(padapter) && check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE))
- || ((hal_btcoex_IsBtControlLps(padapter))
- && (hal_btcoex_IsLpsOn(padapter)))
+ if ((PS_RDY_CHECK(padapter) && check_fwstate(&padapter->mlmepriv, WIFI_ASOC_STATE)) ||
+ ((hal_btcoex_IsBtControlLps(padapter)) && (hal_btcoex_IsLpsOn(padapter)))
) {
u8 pslv;

@@ -472,8 +471,8 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
if (pwrpriv->alives == 0)
pslv = PS_STATE_S0;

- if (!(hal_btcoex_IsBtDisabled(padapter))
- && (hal_btcoex_IsBtControlLps(padapter))) {
+ if (!(hal_btcoex_IsBtDisabled(padapter)) &&
+ (hal_btcoex_IsBtControlLps(padapter))) {
u8 val8;

val8 = hal_btcoex_LpsVal(padapter);
@@ -688,9 +687,9 @@ void LPS_Leave_check(struct adapter *padapter)
while (1) {
mutex_lock(&pwrpriv->lock);

- if (padapter->bSurpriseRemoved
- || !(padapter->hw_init_completed)
- || (pwrpriv->pwr_mode == PS_MODE_ACTIVE))
+ if (padapter->bSurpriseRemoved ||
+ !(padapter->hw_init_completed) ||
+ (pwrpriv->pwr_mode == PS_MODE_ACTIVE))
bReady = true;

mutex_unlock(&pwrpriv->lock);
@@ -897,8 +896,7 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task)
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S0;

- if (!(hal_btcoex_IsBtDisabled(padapter))
- && hal_btcoex_IsBtControlLps(padapter)) {
+ if (!(hal_btcoex_IsBtDisabled(padapter)) && hal_btcoex_IsBtControlLps(padapter)) {
u8 val8;

val8 = hal_btcoex_LpsVal(padapter);
@@ -910,8 +908,7 @@ void rtw_unregister_task_alive(struct adapter *padapter, u32 task)

unregister_task_alive(pwrctrl, task);

- if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE)
- && pwrctrl->bFwCurrentInPSMode) {
+ if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
("%s: cpwm = 0x%02x alives = 0x%08x\n",
__func__, pwrctrl->cpwm, pwrctrl->alives));
@@ -1038,8 +1035,7 @@ void rtw_unregister_tx_alive(struct adapter *padapter)
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S0;

- if (!(hal_btcoex_IsBtDisabled(padapter))
- && hal_btcoex_IsBtControlLps(padapter)) {
+ if (!(hal_btcoex_IsBtDisabled(padapter)) && hal_btcoex_IsBtControlLps(padapter)) {
u8 val8;

val8 = hal_btcoex_LpsVal(padapter);
@@ -1051,8 +1047,7 @@ void rtw_unregister_tx_alive(struct adapter *padapter)

unregister_task_alive(pwrctrl, XMIT_ALIVE);

- if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE)
- && pwrctrl->bFwCurrentInPSMode) {
+ if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_notice_,
("%s: cpwm = 0x%02x alives = 0x%08x\n",
__func__, pwrctrl->cpwm, pwrctrl->alives));
@@ -1080,8 +1075,7 @@ void rtw_unregister_cmd_alive(struct adapter *padapter)
pwrctrl = adapter_to_pwrctl(padapter);
pslv = PS_STATE_S0;

- if (!(hal_btcoex_IsBtDisabled(padapter))
- && hal_btcoex_IsBtControlLps(padapter)) {
+ if (!(hal_btcoex_IsBtDisabled(padapter)) && hal_btcoex_IsBtControlLps(padapter)) {
u8 val8;

val8 = hal_btcoex_LpsVal(padapter);
@@ -1093,8 +1087,7 @@ void rtw_unregister_cmd_alive(struct adapter *padapter)

unregister_task_alive(pwrctrl, CMD_ALIVE);

- if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE)
- && pwrctrl->bFwCurrentInPSMode) {
+ if ((pwrctrl->pwr_mode != PS_MODE_ACTIVE) && pwrctrl->bFwCurrentInPSMode) {
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_info_,
("%s: cpwm = 0x%02x alives = 0x%08x\n",
__func__, pwrctrl->cpwm, pwrctrl->alives));
@@ -1226,8 +1219,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal

if (!(pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
DBG_871X("%s wait bInSuspend...\n", __func__);
- while (pwrpriv->bInSuspend
- && jiffies_to_msecs(jiffies - start) <= 3000
+ while (pwrpriv->bInSuspend && jiffies_to_msecs(jiffies - start) <= 3000
) {
mdelay(10);
}
@@ -1267,10 +1259,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
}

/* TODO: the following checking need to be merged... */
- if (padapter->bDriverStopped
- || !padapter->bup
- || !padapter->hw_init_completed
- ) {
+ if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed) {
DBG_8192C("%s: bDriverStopped =%d, bup =%d, hw_init_completed =%u\n"
, caller
, padapter->bDriverStopped
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index e1528b51c17e..43e67e48d2df 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -499,9 +499,8 @@ union recv_frame *decryptor(struct adapter *padapter, union recv_frame *precv_fr
default:
break;
}
- } else if (prxattrib->bdecrypted == 1
- && prxattrib->encrypt > 0
- && (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)
+ } else if (prxattrib->bdecrypted == 1 && prxattrib->encrypt > 0 &&
+ (psecuritypriv->busetkipkey == 1 || prxattrib->encrypt != _TKIP_)
) {
DBG_COUNTER(padapter->rx_logs.core_rx_post_decrypt_hw);

@@ -874,9 +873,9 @@ sint ap2sta_data_frame(struct adapter *adapter, union recv_frame *precv_frame,
u8 *myhwaddr = myid(&adapter->eeprompriv);
sint bmcast = IS_MCAST(pattrib->dst);

- if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)
- && (check_fwstate(pmlmepriv, _FW_LINKED) == true
- || check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
+ if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) &&
+ (check_fwstate(pmlmepriv, _FW_LINKED) == true ||
+ check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
) {

/* filter packets that SA is myself or multicast or broadcast */
@@ -1226,8 +1225,8 @@ sint validate_recv_mgnt_frame(struct adapter *padapter, union recv_frame *precv_
else if (GetFrameSubType(precv_frame->u.hdr.rx_data) == WIFI_PROBERSP) {
if (!memcmp(padapter->eeprompriv.mac_addr, GetAddr1Ptr(precv_frame->u.hdr.rx_data), ETH_ALEN))
psta->sta_stats.rx_probersp_pkts++;
- else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data))
- || is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
+ else if (is_broadcast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)) ||
+ is_multicast_mac_addr(GetAddr1Ptr(precv_frame->u.hdr.rx_data)))
psta->sta_stats.rx_probersp_bm_pkts++;
else
psta->sta_stats.rx_probersp_uo_pkts++;
@@ -1388,8 +1387,8 @@ static sint validate_80211w_mgmt(struct adapter *adapter, union recv_frame *prec
subtype = GetFrameSubType(ptr); /* bit(7)~bit(2) */

/* only support station mode */
- if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED)
- && adapter->securitypriv.binstallBIPkey == true) {
+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) && check_fwstate(pmlmepriv, _FW_LINKED) &&
+ adapter->securitypriv.binstallBIPkey == true) {
/* unicast management frame decrypt */
if (pattrib->privacy && !(IS_MCAST(GetAddr1Ptr(ptr))) &&
(subtype == WIFI_DEAUTH || subtype == WIFI_DISASSOC || subtype == WIFI_ACTION)) {
@@ -2601,15 +2600,15 @@ static void rtw_signal_stat_timer_hdl(struct timer_list *t)
}

if (num_signal_strength == 0) {
- if (rtw_get_on_cur_ch_time(adapter) == 0
- || jiffies_to_msecs(jiffies - rtw_get_on_cur_ch_time(adapter)) < 2 * adapter->mlmeextpriv.mlmext_info.bcn_interval
+ if (rtw_get_on_cur_ch_time(adapter) == 0 ||
+ jiffies_to_msecs(jiffies - rtw_get_on_cur_ch_time(adapter)) < 2 * adapter->mlmeextpriv.mlmext_info.bcn_interval
) {
goto set_timer;
}
}

- if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == true
- || check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false
+ if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == true ||
+ check_fwstate(&adapter->mlmepriv, _FW_LINKED) == false
) {
goto set_timer;
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
index a6176e86f370..45e5f06f0004 100644
--- a/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8723bs/core/rtw_wlan_util.c
@@ -1584,9 +1584,9 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
if ((!memcmp(pIE->data, ARTHEROS_OUI1, 3)) || (!memcmp(pIE->data, ARTHEROS_OUI2, 3))) {
DBG_871X("link to Artheros AP\n");
return HT_IOT_PEER_ATHEROS;
- } else if ((!memcmp(pIE->data, BROADCOM_OUI1, 3))
- || (!memcmp(pIE->data, BROADCOM_OUI2, 3))
- || (!memcmp(pIE->data, BROADCOM_OUI3, 3))) {
+ } else if ((!memcmp(pIE->data, BROADCOM_OUI1, 3)) ||
+ (!memcmp(pIE->data, BROADCOM_OUI2, 3)) ||
+ (!memcmp(pIE->data, BROADCOM_OUI3, 3))) {
DBG_871X("link to Broadcom AP\n");
return HT_IOT_PEER_BROADCOM;
} else if (!memcmp(pIE->data, MARVELL_OUI, 3)) {
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index b69998c5c07e..6582f2d7c383 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -2173,9 +2173,9 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
struct pkt_attrib *attrib = &xmitframe->attrib;

- if (attrib->ether_type == 0x0806
- || attrib->ether_type == 0x888e
- || attrib->dhcp_pkt
+ if (attrib->ether_type == 0x0806 ||
+ attrib->ether_type == 0x888e ||
+ attrib->dhcp_pkt
) {
DBG_871X(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter)
, attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
--
2.25.1