[PATCH 01/11] staging: rtl8723bs: core: fix spacing around operators and casts

luka.gejak
2026-04-13T10:15:24Z

Fix spaces around operators and casts in the core directory to adhere
to the Linux kernel coding style. This resolves multiple spacing
warnings reported by checkpatch.pl.

Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
---
.../staging/rtl8723bs/core/rtw_ioctl_set.c | 6 +-
drivers/staging/rtl8723bs/core/rtw_mlme.c | 4 +-
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 202 +++++++++---------
drivers/staging/rtl8723bs/core/rtw_recv.c | 6 +-
4 files changed, 109 insertions(+), 109 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index c70541f95a73..439b91862d55 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -151,7 +151,7 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)
goto release_mlme_lock;

- if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true) {
+ if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE) == true) {
if ((pmlmepriv->assoc_ssid.ssid_length == ssid->ssid_length) &&
(!memcmp(&pmlmepriv->assoc_ssid.ssid, ssid->ssid, ssid->ssid_length))) {
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == false) {
@@ -487,13 +487,13 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
psta->htpriv.ht_cap.mcs.rx_mask);
} else {
while ((pcur_bss->supported_rates[i] != 0) && (pcur_bss->supported_rates[i] != 0xFF)) {
- rate = pcur_bss->supported_rates[i]&0x7F;
+ rate = pcur_bss->supported_rates[i] & 0x7F;
if (rate > max_rate)
max_rate = rate;
i++;
}

- max_rate = max_rate*10/2;
+ max_rate = max_rate * 10 / 2;
}

return max_rate;
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index ddfc56f0253d..35ee65c7a458 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1075,7 +1075,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
rtw_update_protection(padapter, (cur_network->network.ies) + sizeof(struct ndis_802_11_fix_ie),
(cur_network->network.ie_length));

- rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
+ rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8)cur_network->network.configuration.ds_config);
}

static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
@@ -2502,7 +2502,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr

if (issued == 0) {
psta->htpriv.candidate_tid_bitmap |= BIT((u8)priority);
- rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra);
+ rtw_addbareq_cmd(padapter, (u8)priority, pattrib->ra);
}
}
}
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index 5f00fe282d1b..07e1b30239a3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -326,7 +326,7 @@ static u8 init_channel_set(struct adapter *padapter, u8 ChannelPlan, struct rt_c
u8 b2_4GBand = false;
u8 Index2G = 0;

- memset(channel_set, 0, sizeof(struct rt_channel_info)*MAX_CHANNEL_NUM);
+ memset(channel_set, 0, sizeof(struct rt_channel_info) * MAX_CHANNEL_NUM);

if (ChannelPlan >= RT_CHANNEL_DOMAIN_MAX && ChannelPlan != RT_CHANNEL_DOMAIN_REALTEK_DEFINE)
return chanset_size;
@@ -513,7 +513,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
return _SUCCESS;

if (check_fwstate(pmlmepriv, _FW_LINKED) == false &&
- check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE) == false) {
+ check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE) == false) {
return _SUCCESS;
}

@@ -526,7 +526,7 @@ unsigned int OnProbeReq(struct adapter *padapter, union recv_frame *precv_frame)
if (is_valid_p2p_probereq)
goto _issue_probersp;

- if ((ielen != 0 && false == !memcmp((p+2), cur->ssid.ssid, cur->ssid.ssid_length))
+ if ((ielen != 0 && false == !memcmp((p + 2), cur->ssid.ssid, cur->ssid.ssid_length))
|| (ielen == 0 && pmlmeinfo->hidden_ssid_mode)
)
return _SUCCESS;
@@ -597,7 +597,7 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)
}

/* check the vendor of the assoc AP */
- pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe+sizeof(struct ieee80211_hdr_3addr), len-sizeof(struct ieee80211_hdr_3addr));
+ pmlmeinfo->assoc_AP_vendor = check_assoc_AP(pframe + sizeof(struct ieee80211_hdr_3addr), len - sizeof(struct ieee80211_hdr_3addr));

/* update TSF Value */
update_TSF(pmlmeext, pframe, len);
@@ -616,7 +616,7 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)
return _SUCCESS;
}

- if (((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
+ if (((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) && (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS)) {
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
if (psta) {
ret = rtw_check_bcn_info(padapter, pframe, len);
@@ -634,7 +634,7 @@ unsigned int OnBeacon(struct adapter *padapter, union recv_frame *precv_frame)

adaptive_early_32k(pmlmeext, pframe, len);
}
- } else if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
+ } else if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
if (psta) {
/* update WMM, ERP in the beacon */
@@ -684,7 +684,7 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
uint len = precv_frame->u.hdr.len;
u8 offset = 0;

- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
return _FAIL;

sa = GetAddr2Ptr(pframe);
@@ -698,8 +698,8 @@ unsigned int OnAuth(struct adapter *padapter, union recv_frame *precv_frame)
prxattrib->hdrlen = WLAN_HDR_A3_LEN;
prxattrib->encrypt = _WEP40_;

- iv = pframe+prxattrib->hdrlen;
- prxattrib->key_index = ((iv[3]>>6)&0x3);
+ iv = pframe + prxattrib->hdrlen;
+ prxattrib->key_index = ((iv[3] >> 6) & 0x3);

prxattrib->iv_len = 4;
prxattrib->icv_len = 4;
@@ -949,7 +949,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
u8 *pframe = precv_frame->u.hdr.rx_data;
uint pkt_len = precv_frame->u.hdr.len;

- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
return _FAIL;

frame_type = GetFrameSubType(pframe);
@@ -1009,7 +1009,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
goto OnAssocReqFail;
} else {
/* check if ssid match */
- if (memcmp(p+2, cur->ssid.ssid, cur->ssid.ssid_length))
+ if (memcmp(p + 2, cur->ssid.ssid, cur->ssid.ssid_length))
status = WLAN_STATUS_CHALLENGE_FAIL;

if (ie_len != cur->ssid.ssid_length)
@@ -1032,7 +1032,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
if (ie_len > sizeof(supportRate))
ie_len = sizeof(supportRate);

- memcpy(supportRate, p+2, ie_len);
+ memcpy(supportRate, p + 2, ie_len);
support_rate_num = ie_len;

p = rtw_get_ie(pframe + WLAN_HDR_A3_LEN + ie_offset, WLAN_EID_EXT_SUPP_RATES, &ie_len,
@@ -1069,12 +1069,12 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
wpa_ie = elems.rsn_ie;
wpa_ie_len = elems.rsn_ie_len;

- if (rtw_parse_wpa2_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
+ if (rtw_parse_wpa2_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
pstat->dot8021xalg = 1;/* psk, todo:802.1x */
pstat->wpa_psk |= BIT(1);

- pstat->wpa2_group_cipher = group_cipher&psecuritypriv->wpa2_group_cipher;
- pstat->wpa2_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa2_pairwise_cipher;
+ pstat->wpa2_group_cipher = group_cipher & psecuritypriv->wpa2_group_cipher;
+ pstat->wpa2_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa2_pairwise_cipher;

if (!pstat->wpa2_group_cipher)
status = WLAN_STATUS_INVALID_GROUP_CIPHER;
@@ -1092,12 +1092,12 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
wpa_ie = elems.wpa_ie;
wpa_ie_len = elems.wpa_ie_len;

- if (rtw_parse_wpa_ie(wpa_ie-2, wpa_ie_len+2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
+ if (rtw_parse_wpa_ie(wpa_ie - 2, wpa_ie_len + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
pstat->dot8021xalg = 1;/* psk, todo:802.1x */
pstat->wpa_psk |= BIT(0);

- pstat->wpa_group_cipher = group_cipher&psecuritypriv->wpa_group_cipher;
- pstat->wpa_pairwise_cipher = pairwise_cipher&psecuritypriv->wpa_pairwise_cipher;
+ pstat->wpa_group_cipher = group_cipher & psecuritypriv->wpa_group_cipher;
+ pstat->wpa_pairwise_cipher = pairwise_cipher & psecuritypriv->wpa_pairwise_cipher;

if (!pstat->wpa_group_cipher)
status = WLAN_STATUS_INVALID_GROUP_CIPHER;
@@ -1128,7 +1128,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
/* AP support WPA/RSN, and sta is going to do WPS, but AP is not ready */
/* that the selected registrar of AP is _FLASE */
if ((psecuritypriv->wpa_psk > 0)
- && (pstat->flags & (WLAN_STA_WPS|WLAN_STA_MAYBE_WPS))) {
+ && (pstat->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS))) {
if (pmlmepriv->wps_beacon_ie) {
u8 selected_registrar = 0;

@@ -1161,7 +1161,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)

if (copy_len > 0)
- memcpy(pstat->wpa_ie, wpa_ie-2, copy_len);
+ memcpy(pstat->wpa_ie, wpa_ie - 2, copy_len);

}

@@ -1182,7 +1182,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
if (!p)
break;

- if (memcmp(p+2, WMM_IE, 6)) {
+ if (memcmp(p + 2, WMM_IE, 6)) {
p = p + ie_len + 2;
continue;
}
@@ -1190,33 +1190,33 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
pstat->flags |= WLAN_STA_WME;

pstat->qos_option = 1;
- pstat->qos_info = *(p+8);
+ pstat->qos_info = *(p + 8);

- pstat->max_sp_len = (pstat->qos_info>>5)&0x3;
+ pstat->max_sp_len = (pstat->qos_info >> 5) & 0x3;

- if ((pstat->qos_info&0xf) != 0xf)
+ if ((pstat->qos_info & 0xf) != 0xf)
pstat->has_legacy_ac = true;
else
pstat->has_legacy_ac = false;

- if (pstat->qos_info&0xf) {
- if (pstat->qos_info&BIT(0))
- pstat->uapsd_vo = BIT(0)|BIT(1);
+ if (pstat->qos_info & 0xf) {
+ if (pstat->qos_info & BIT(0))
+ pstat->uapsd_vo = BIT(0) | BIT(1);
else
pstat->uapsd_vo = 0;

- if (pstat->qos_info&BIT(1))
- pstat->uapsd_vi = BIT(0)|BIT(1);
+ if (pstat->qos_info & BIT(1))
+ pstat->uapsd_vi = BIT(0) | BIT(1);
else
pstat->uapsd_vi = 0;

- if (pstat->qos_info&BIT(2))
- pstat->uapsd_bk = BIT(0)|BIT(1);
+ if (pstat->qos_info & BIT(2))
+ pstat->uapsd_bk = BIT(0) | BIT(1);
else
pstat->uapsd_bk = 0;

- if (pstat->qos_info&BIT(3))
- pstat->uapsd_be = BIT(0)|BIT(1);
+ if (pstat->qos_info & BIT(3))
+ pstat->uapsd_be = BIT(0) | BIT(1);
else
pstat->uapsd_be = 0;

@@ -1239,15 +1239,15 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
pstat->flags &= ~WLAN_STA_HT;

- if ((pmlmepriv->htpriv.ht_option == false) && (pstat->flags&WLAN_STA_HT)) {
+ if ((pmlmepriv->htpriv.ht_option == false) && (pstat->flags & WLAN_STA_HT)) {
status = WLAN_STATUS_CHALLENGE_FAIL;
goto OnAssocReqFail;
}

if ((pstat->flags & WLAN_STA_HT) &&
- ((pstat->wpa2_pairwise_cipher&WPA_CIPHER_TKIP) ||
- (pstat->wpa_pairwise_cipher&WPA_CIPHER_TKIP))) {
+ ((pstat->wpa2_pairwise_cipher & WPA_CIPHER_TKIP) ||
+ (pstat->wpa_pairwise_cipher & WPA_CIPHER_TKIP))) {
/* status = WLAN_STATUS_CIPHER_SUITE_REJECTED; */
/* goto OnAssocReqFail; */
}
@@ -1394,7 +1394,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, union recv_frame *precv_frame)
pmlmeinfo->slotTime = (pmlmeinfo->capability & BIT(10)) ? 9 : 20;

/* AID */
- res = pmlmeinfo->aid = (int)(le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 4))&0x3fff);
+ res = pmlmeinfo->aid = (int)(le16_to_cpu(*(__le16 *)(pframe + WLAN_HDR_A3_LEN + 4)) & 0x3fff);

/* following are moved to join event callback function */
/* to handle HT, WMM, rate adaptive, update MAC reg */
@@ -1626,7 +1626,7 @@ unsigned int OnAction_back(struct adapter *padapter, union recv_frame *precv_fra
if (memcmp(myid(&(padapter->eeprompriv)), GetAddr1Ptr(pframe), ETH_ALEN))/* for if1, sta/ap mode */
return _SUCCESS;

- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;

@@ -1706,7 +1706,7 @@ static s32 rtw_action_public_decache(union recv_frame *recv_frame, s32 token)
struct adapter *adapter = recv_frame->u.hdr.adapter;
struct mlme_ext_priv *mlmeext = &(adapter->mlmeextpriv);
u8 *frame = recv_frame->u.hdr.rx_data;
- u16 seq_ctrl = ((recv_frame->u.hdr.attrib.seq_num&0xffff) << 4) |
+ u16 seq_ctrl = ((recv_frame->u.hdr.attrib.seq_num & 0xffff) << 4) |
(recv_frame->u.hdr.attrib.frag_num & 0xf);

if (GetRetry(frame)) {
@@ -1842,9 +1842,9 @@ unsigned int OnAction_sa_query(struct adapter *padapter, union recv_frame *precv
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
unsigned short tid;

- switch (pframe[WLAN_HDR_A3_LEN+1]) {
+ switch (pframe[WLAN_HDR_A3_LEN + 1]) {
case 0: /* SA Query req */
- memcpy(&tid, &pframe[WLAN_HDR_A3_LEN+2], sizeof(unsigned short));
+ memcpy(&tid, &pframe[WLAN_HDR_A3_LEN + 2], sizeof(unsigned short));
issue_action_SA_Query(padapter, GetAddr2Ptr(pframe), 1, tid);
break;

@@ -2066,10 +2066,10 @@ static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode)
u8 *next_ie = ssid_ie + 2 + ssid_len_ori;
u32 remain_len = 0;

- remain_len = ies_len - (next_ie-ies);
+ remain_len = ies_len - (next_ie - ies);

ssid_ie[1] = 0;
- memcpy(ssid_ie+2, next_ie, remain_len);
+ memcpy(ssid_ie + 2, next_ie, remain_len);
len_diff -= ssid_len_ori;

break;
@@ -2130,16 +2130,16 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
pframe += sizeof(struct ieee80211_hdr_3addr);
pattrib->pktlen = sizeof(struct ieee80211_hdr_3addr);

- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
{
int len_diff;

memcpy(pframe, cur_network->ies, cur_network->ie_length);
- len_diff = update_hidden_ssid(pframe+_BEACON_IE_OFFSET_,
- cur_network->ie_length-_BEACON_IE_OFFSET_,
+ len_diff = update_hidden_ssid(pframe + _BEACON_IE_OFFSET_,
+ cur_network->ie_length - _BEACON_IE_OFFSET_,
pmlmeinfo->hidden_ssid_mode);
- pframe += (cur_network->ie_length+len_diff);
- pattrib->pktlen += (cur_network->ie_length+len_diff);
+ pframe += (cur_network->ie_length + len_diff);
+ pattrib->pktlen += (cur_network->ie_length + len_diff);
}

{
@@ -2147,8 +2147,8 @@ void issue_beacon(struct adapter *padapter, int timeout_ms)
uint wps_ielen;
u8 sr = 0;

- wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr)+_BEACON_IE_OFFSET_,
- pattrib->pktlen-sizeof(struct ieee80211_hdr_3addr)-_BEACON_IE_OFFSET_, NULL, &wps_ielen);
+ wps_ie = rtw_get_wps_ie(pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr) + _BEACON_IE_OFFSET_,
+ pattrib->pktlen - sizeof(struct ieee80211_hdr_3addr) - _BEACON_IE_OFFSET_, NULL, &wps_ielen);
if (wps_ie && wps_ielen > 0)
rtw_get_wps_attr_content(wps_ie, wps_ielen, WPS_ATTR_SELECTED_REGISTRAR, (u8 *)(&sr), NULL);
if (sr != 0)
@@ -2285,8 +2285,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
if (cur_network->ie_length > MAX_IE_SZ)
return;

- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
- pwps_ie = rtw_get_wps_ie(cur_network->ies+_FIXED_IE_LENGTH_, cur_network->ie_length-_FIXED_IE_LENGTH_, NULL, &wps_ielen);
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
+ pwps_ie = rtw_get_wps_ie(cur_network->ies + _FIXED_IE_LENGTH_, cur_network->ie_length - _FIXED_IE_LENGTH_, NULL, &wps_ielen);

/* inerset & update wps_probe_resp_ie */
if (pmlmepriv->wps_probe_resp_ie && pwps_ie && wps_ielen > 0) {
@@ -2304,13 +2304,13 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
pattrib->pktlen += wps_offset;

wps_ielen = (uint)pmlmepriv->wps_probe_resp_ie[1];/* to get ie data len */
- if ((wps_offset+wps_ielen+2) <= MAX_IE_SZ) {
- memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen+2);
- pframe += wps_ielen+2;
- pattrib->pktlen += wps_ielen+2;
+ if ((wps_offset + wps_ielen + 2) <= MAX_IE_SZ) {
+ memcpy(pframe, pmlmepriv->wps_probe_resp_ie, wps_ielen + 2);
+ pframe += wps_ielen + 2;
+ pattrib->pktlen += wps_ielen + 2;
}

- if ((wps_offset+wps_ielen+2+remainder_ielen) <= MAX_IE_SZ) {
+ if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
memcpy(pframe, premainder_ie, remainder_ielen);
pframe += remainder_ielen;
pattrib->pktlen += remainder_ielen;
@@ -2327,14 +2327,14 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
signed int ssid_ielen;
signed int ssid_ielen_diff;
u8 *buf;
- u8 *ies = pmgntframe->buf_addr+TXDESC_OFFSET+sizeof(struct ieee80211_hdr_3addr);
+ u8 *ies = pmgntframe->buf_addr + TXDESC_OFFSET + sizeof(struct ieee80211_hdr_3addr);

buf = kzalloc(MAX_IE_SZ, GFP_ATOMIC);
if (!buf)
return;

- ssid_ie = rtw_get_ie(ies+_FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen,
- (pframe-ies)-_FIXED_IE_LENGTH_);
+ ssid_ie = rtw_get_ie(ies + _FIXED_IE_LENGTH_, WLAN_EID_SSID, &ssid_ielen,
+ (pframe - ies) - _FIXED_IE_LENGTH_);

ssid_ielen_diff = cur_network->ssid.ssid_length - ssid_ielen;

@@ -2342,8 +2342,8 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
uint remainder_ielen;
u8 *remainder_ie;

- remainder_ie = ssid_ie+2;
- remainder_ielen = (pframe-remainder_ie);
+ remainder_ie = ssid_ie + 2;
+ remainder_ielen = (pframe - remainder_ie);

if (remainder_ielen > MAX_IE_SZ) {
netdev_warn(padapter->pnetdev,
@@ -2353,9 +2353,9 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
}

memcpy(buf, remainder_ie, remainder_ielen);
- memcpy(remainder_ie+ssid_ielen_diff, buf, remainder_ielen);
- *(ssid_ie+1) = cur_network->ssid.ssid_length;
- memcpy(ssid_ie+2, cur_network->ssid.ssid, cur_network->ssid.ssid_length);
+ memcpy(remainder_ie + ssid_ielen_diff, buf, remainder_ielen);
+ *(ssid_ie + 1) = cur_network->ssid.ssid_length;
+ memcpy(ssid_ie + 2, cur_network->ssid.ssid, cur_network->ssid.ssid_length);

pframe += ssid_ielen_diff;
pattrib->pktlen += ssid_ielen_diff;
@@ -2393,7 +2393,7 @@ void issue_probersp(struct adapter *padapter, unsigned char *da, u8 is_valid_p2p
/* DS parameter set */
pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->configuration.ds_config), &pattrib->pktlen);

- if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
u8 erpinfo = 0;
u32 ATIMWindow;
/* IBSS Parameter Set... */
@@ -2748,7 +2748,7 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i
pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, pstat->bssratelen, pstat->bssrateset, &(pattrib->pktlen));
} else {
pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, 8, pstat->bssrateset, &(pattrib->pktlen));
- pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (pstat->bssratelen-8), pstat->bssrateset+8, &(pattrib->pktlen));
+ pframe = rtw_set_ie(pframe, WLAN_EID_EXT_SUPP_RATES, (pstat->bssratelen - 8), pstat->bssrateset + 8, &(pattrib->pktlen));
}

if ((pstat->flags & WLAN_STA_HT) && (pmlmepriv->htpriv.ht_option)) {
@@ -2758,18 +2758,18 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i
/* p = hostapd_eid_ht_capabilities_info(hapd, p); */
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_CAPABILITY, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_));
if (pbuf && ie_len > 0) {
- memcpy(pframe, pbuf, ie_len+2);
- pframe += (ie_len+2);
- pattrib->pktlen += (ie_len+2);
+ memcpy(pframe, pbuf, ie_len + 2);
+ pframe += (ie_len + 2);
+ pattrib->pktlen += (ie_len + 2);
}

/* FILL HT ADD INFO IE */
/* p = hostapd_eid_ht_operation(hapd, p); */
pbuf = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_HT_OPERATION, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_));
if (pbuf && ie_len > 0) {
- memcpy(pframe, pbuf, ie_len+2);
- pframe += (ie_len+2);
- pattrib->pktlen += (ie_len+2);
+ memcpy(pframe, pbuf, ie_len + 2);
+ pframe += (ie_len + 2);
+ pattrib->pktlen += (ie_len + 2);
}

}
@@ -2781,10 +2781,10 @@ void issue_asocrsp(struct adapter *padapter, unsigned short status, struct sta_i

for (pbuf = ie + _BEACON_IE_OFFSET_; ; pbuf += (ie_len + 2)) {
pbuf = rtw_get_ie(pbuf, WLAN_EID_VENDOR_SPECIFIC, &ie_len, (pnetwork->ie_length - _BEACON_IE_OFFSET_ - (ie_len + 2)));
- if (pbuf && !memcmp(pbuf+2, WMM_PARA_IE, 6)) {
- memcpy(pframe, pbuf, ie_len+2);
- pframe += (ie_len+2);
- pattrib->pktlen += (ie_len+2);
+ if (pbuf && !memcmp(pbuf + 2, WMM_PARA_IE, 6)) {
+ memcpy(pframe, pbuf, ie_len + 2);
+ pframe += (ie_len + 2);
+ pattrib->pktlen += (ie_len + 2);

break;
}
@@ -3024,9 +3024,9 @@ static int _issue_nulldata(struct adapter *padapter, unsigned char *da,
fctrl = &(pwlanhdr->frame_control);
*(fctrl) = 0;

- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
SetFrDs(fctrl);
- else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
SetToDs(fctrl);

if (power_mode)
@@ -3168,9 +3168,9 @@ static int _issue_qos_nulldata(struct adapter *padapter, unsigned char *da,
fctrl = &(pwlanhdr->frame_control);
*(fctrl) = 0;

- if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
SetFrDs(fctrl);
- else if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ else if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
SetToDs(fctrl);

qc = (unsigned short *)(pframe + pattrib->hdrlen - 2);
@@ -3706,7 +3706,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u16 tid;

- if ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE)
+ if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
if (!(pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS))
return _SUCCESS;

@@ -3717,7 +3717,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
if (initiator == 0) {/* recipient */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->recvreorder_ctrl[tid].enable) {
- issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F));
+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->recvreorder_ctrl[tid].enable = false;
psta->recvreorder_ctrl[tid].indicate_seq = 0xffff;
}
@@ -3725,7 +3725,7 @@ unsigned int send_delba(struct adapter *padapter, u8 initiator, u8 *addr)
} else if (initiator == 1) {/* originator */
for (tid = 0; tid < MAXTID; tid++) {
if (psta->htpriv.agg_enable_bitmap & BIT(tid)) {
- issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator)&0x1F));
+ issue_action_BA(padapter, addr, WLAN_ACTION_DELBA, (((tid << 1) | initiator) & 0x1F));
psta->htpriv.agg_enable_bitmap &= ~BIT(tid);
psta->htpriv.candidate_tid_bitmap &= ~BIT(tid);

@@ -3752,7 +3752,7 @@ unsigned int send_beacon(struct adapter *padapter)
cond_resched();
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bxmitok));
poll++;
- } while ((poll%10) != 0 && false == bxmitok && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
+ } while ((poll % 10) != 0 && false == bxmitok && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);

} while (false == bxmitok && issue < 100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);

@@ -3965,7 +3965,7 @@ u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame, str

p = rtw_get_ie(bssid->ies + ie_offset, WLAN_EID_EXT_SUPP_RATES, &len, bssid->ie_length - ie_offset);
if (p) {
- if (len > (NDIS_802_11_LENGTH_RATES_EX-i))
+ if (len > (NDIS_802_11_LENGTH_RATES_EX - i))
return _FAIL;

memcpy(bssid->supported_rates + i, (p + 2), len);
@@ -4058,7 +4058,7 @@ void start_create_ibss(struct adapter *padapter)
/* update capability */
caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
update_capinfo(padapter, caps);
- if (caps&WLAN_CAPABILITY_IBSS) {/* adhoc master */
+ if (caps & WLAN_CAPABILITY_IBSS) {/* adhoc master */
val8 = 0xcf;
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));

@@ -4110,7 +4110,7 @@ void start_clnt_join(struct adapter *padapter)
/* update capability */
caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
update_capinfo(padapter, caps);
- if (caps&WLAN_CAPABILITY_ESS) {
+ if (caps & WLAN_CAPABILITY_ESS) {
set_msr(padapter, WIFI_FW_STATION_STATE);

val8 = (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) ? 0xcc : 0xcf;
@@ -4134,10 +4134,10 @@ void start_clnt_join(struct adapter *padapter)
beacon_timeout = decide_wait_for_beacon_timeout(pmlmeinfo->bcn_interval);
set_link_timer(pmlmeext, beacon_timeout);
_set_timer(&padapter->mlmepriv.assoc_timer,
- (REAUTH_TO * REAUTH_LIMIT) + (REASSOC_TO*REASSOC_LIMIT) + beacon_timeout);
+ (REAUTH_TO * REAUTH_LIMIT) + (REASSOC_TO * REASSOC_LIMIT) + beacon_timeout);

pmlmeinfo->state = WIFI_FW_AUTH_NULL | WIFI_FW_STATION_STATE;
- } else if (caps&WLAN_CAPABILITY_IBSS) { /* adhoc client */
+ } else if (caps & WLAN_CAPABILITY_IBSS) { /* adhoc client */
set_msr(padapter, WIFI_FW_ADHOC_STATE);

val8 = 0xcf;
@@ -4203,7 +4203,7 @@ unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr
if (!(!memcmp(MacAddr, get_my_bssid(&pmlmeinfo->network), ETH_ALEN)))
return _SUCCESS;

- if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) {
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) {
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
pmlmeinfo->state = WIFI_FW_NULL_STATE;
report_del_sta_event(padapter, MacAddr, reason);
@@ -4265,7 +4265,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
if (fcn <= 14)
channel = fcn + j; /* 2.4 GHz */
else
- channel = fcn + j*4; /* 5 GHz */
+ channel = fcn + j * 4; /* 5 GHz */

chplan_ap.Channel[i++] = channel;
}
@@ -4672,7 +4672,7 @@ void update_sta_info(struct adapter *padapter, struct sta_info *psta)

psta->htpriv.ampdu_enable = pmlmepriv->htpriv.ampdu_enable;

- psta->htpriv.rx_ampdu_min_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para&IEEE80211_HT_CAP_AMPDU_DENSITY)>>2;
+ psta->htpriv.rx_ampdu_min_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & IEEE80211_HT_CAP_AMPDU_DENSITY) >> 2;

if (support_short_GI(padapter, &(pmlmeinfo->HT_caps), CHANNEL_WIDTH_20))
psta->htpriv.sgi_20m = true;
@@ -4780,7 +4780,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
return;
}

- if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE)
/* update bc/mc sta_info */
update_bmc_sta(padapter);

@@ -4830,7 +4830,7 @@ void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res)
join_type = 2;
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));

- if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE) {
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE) {
/* correcting TSF */
correct_TSF(padapter, pmlmeext);

@@ -4847,7 +4847,7 @@ void mlmeext_sta_add_event_callback(struct adapter *padapter, struct sta_info *p
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
u8 join_type;

- if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) { /* adhoc master or sta_count>1 */

/* nothing to do */
@@ -4911,7 +4911,7 @@ void _linked_info_dump(struct adapter *padapter)

if (padapter->bLinkInfoDump) {

- if ((pmlmeinfo->state&0x03) == WIFI_FW_STATION_STATE)
+ if ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE)
rtw_hal_get_def_var(padapter,
HAL_DEF_UNDERCORATEDSMOOTHEDPWDB,
&UndecoratedSmoothedPWDB);
@@ -5407,9 +5407,9 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
u8 val8;

if (is_client_associated_to_ap(padapter))
- issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms/100, 100);
+ issue_deauth_ex(padapter, pnetwork->mac_address, WLAN_REASON_DEAUTH_LEAVING, param->deauth_timeout_ms / 100, 100);

- if (((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) {
+ if (((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) || ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) {
/* Stop BCN */
val8 = 0;
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_FUNC, (u8 *)(&val8));
@@ -5430,7 +5430,7 @@ static int rtw_scan_ch_decision(struct adapter *padapter, struct rtw_ieee80211_c
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;

/* clear first */
- memset(out, 0, sizeof(struct rtw_ieee80211_channel)*out_num);
+ memset(out, 0, sizeof(struct rtw_ieee80211_channel) * out_num);

/* acquire channels from in */
j = 0;
@@ -5671,7 +5671,7 @@ u8 add_ba_hdl(struct adapter *padapter, unsigned char *pbuf)
return H2C_SUCCESS;

if (((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && (pmlmeinfo->HT_enable)) ||
- ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)) {
+ ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)) {
/* pmlmeinfo->ADDBA_retry_count = 0; */
/* pmlmeinfo->candidate_tid_bitmap |= (0x1 << pparm->tid); */
/* psta->htpriv.candidate_tid_bitmap |= BIT(pparm->tid); */
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index f78194d508df..d0d6efaee2af 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -58,7 +58,7 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *pada
/* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */
/* ((SIZE_PTR) (precvpriv->pallocated_frame_buf) &(RXFRAME_ALIGN_SZ-1)); */

- precvframe = (union recv_frame *) precvpriv->precv_frame_buf;
+ precvframe = (union recv_frame *)precvpriv->precv_frame_buf;

for (i = 0; i < NR_RECVFRAME; i++) {
@@ -1492,7 +1492,7 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;

u8 *ptr = precv_frame->u.hdr.rx_data;
- u8 ver = (unsigned char) (*ptr) & 0x3;
+ u8 ver = (unsigned char)(*ptr) & 0x3;

/* add version chk */
if (ver != 0) {
@@ -1545,7 +1545,7 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
/* get ether_type */
memcpy(&eth_type, ptr + pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_LENGTH, 2);
- eth_type = ntohs((unsigned short) eth_type);
+ eth_type = ntohs((unsigned short)eth_type);
#endif
}
break;
--
2.53.0