* [PATCH] staging: rtl8723bs: rtw_mlme: fix line length warnings
@ 2026-04-24 21:16 Salman Alghamdi
2026-04-25 12:45 ` Luka Gejak
0 siblings, 1 reply; 2+ messages in thread
From: Salman Alghamdi @ 2026-04-24 21:16 UTC (permalink / raw)
To: gregkh; +Cc: straube.linux, linux-staging, linux-kernel
Fix lines exceeding 100 columns in rtw_mlme.c as flagged by
checkpatch.pl. Wrap long function signatures, function calls,
assignments, and block comments to bring all lines within the
100 column limit.
Signed-off-by: Salman Alghamdi <me@cipherat.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 258 +++++++++++++++-------
1 file changed, 182 insertions(+), 76 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index ddfc56f0253d..fe996484a6ed 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -52,7 +52,10 @@ int rtw_init_mlme_priv(struct adapter *padapter)
pmlmepriv->pscanned = NULL;
pmlmepriv->fw_state = WIFI_STATION_STATE; /* Must sync with rtw_wdev_alloc() */
pmlmepriv->cur_network.network.infrastructure_mode = Ndis802_11AutoUnknown;
- pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
+ /* 1: active, 0: passive. Maybe someday we should rename this
+ * variable to "active_mode" (Jeff)
+ */
+ pmlmepriv->scan_mode = SCAN_ACTIVE;
spin_lock_init(&pmlmepriv->lock);
INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
@@ -125,7 +128,8 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
rtw_free_mlme_ie_data(&pmlmepriv->p2p_beacon_ie, &pmlmepriv->p2p_beacon_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_req_ie, &pmlmepriv->p2p_probe_req_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_resp_ie, &pmlmepriv->p2p_probe_resp_ie_len);
- rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie, &pmlmepriv->p2p_go_probe_resp_ie_len);
+ rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie,
+ &pmlmepriv->p2p_go_probe_resp_ie_len);
rtw_free_mlme_ie_data(&pmlmepriv->p2p_assoc_req_ie, &pmlmepriv->p2p_assoc_req_ie_len);
}
@@ -369,7 +373,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea
(d_cap & WLAN_CAPABILITY_ESS));
}
-struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network)
+struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue,
+ struct wlan_network *network)
{
struct list_head *phead, *plist;
struct wlan_network *found = NULL;
@@ -420,7 +425,8 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
long rssi_final;
/* The rule below is 1/5 for sample value, 4/5 for history value */
- if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&padapter->mlmepriv.cur_network.network, src, 0)) {
+ if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) &&
+ is_same_network(&padapter->mlmepriv.cur_network.network, src, 0)) {
/* Take the recvpriv's value for the connected AP*/
ss_final = padapter->recvpriv.signal_strength;
sq_final = padapter->recvpriv.signal_qual;
@@ -431,11 +437,15 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
rssi_final = rssi_ori;
} else {
if (sq_smp != 101) { /* from the right channel */
- ss_final = ((u32)(src->phy_info.signal_strength) + (u32)(dst->phy_info.signal_strength) * 4) / 5;
- sq_final = ((u32)(src->phy_info.signal_quality) + (u32)(dst->phy_info.signal_quality) * 4) / 5;
+ ss_final = ((u32)(src->phy_info.signal_strength) +
+ (u32)(dst->phy_info.signal_strength) * 4) / 5;
+ sq_final = ((u32)(src->phy_info.signal_quality) +
+ (u32)(dst->phy_info.signal_quality) * 4) / 5;
rssi_final = (src->rssi + dst->rssi * 4) / 5;
} else {
- /* bss info not receiving from the right channel, use the original RX signal infos */
+ /* bss info not receiving from the right channel,
+ * use the original RX signal infos
+ */
ss_final = dst->phy_info.signal_strength;
sq_final = dst->phy_info.signal_quality;
rssi_final = dst->rssi;
@@ -462,10 +472,13 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
&pmlmepriv->cur_network.network,
&pmlmepriv->cur_network.network);
- if (check_fwstate(pmlmepriv, _FW_LINKED) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
+ if (check_fwstate(pmlmepriv, _FW_LINKED) &&
+ (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
- rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
- pmlmepriv->cur_network.network.ie_length);
+ rtw_update_protection(adapter,
+ (pmlmepriv->cur_network.network.ies) +
+ sizeof(struct ndis_802_11_fix_ie),
+ pmlmepriv->cur_network.network.ie_length);
}
}
@@ -601,7 +614,10 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
privacy = pnetwork->network.privacy;
if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
- if (rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wps_ielen))
+ if (rtw_get_wps_ie(pnetwork->network.ies +
+ _FIXED_IE_LENGTH_,
+ pnetwork->network.ie_length - _FIXED_IE_LENGTH_,
+ NULL, &wps_ielen))
return true;
else
return false;
@@ -614,7 +630,10 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
bselected = false;
if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
- p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
+ p = rtw_get_ie(pnetwork->network.ies +
+ _BEACON_IE_OFFSET_,
+ WLAN_EID_RSN, &ie_len,
+ (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
if (p && ie_len > 0)
bselected = true;
else
@@ -626,7 +645,8 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
bselected = false;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
- if (pnetwork->network.infrastructure_mode != pmlmepriv->cur_network.network.infrastructure_mode)
+ if (pnetwork->network.infrastructure_mode !=
+ pmlmepriv->cur_network.network.infrastructure_mode)
bselected = false;
}
@@ -654,12 +674,14 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
/* update IBSS_network 's timestamp */
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
- if (!memcmp(&pmlmepriv->cur_network.network.mac_address, pnetwork->mac_address, ETH_ALEN)) {
+ if (!memcmp(&pmlmepriv->cur_network.network.mac_address,
+ pnetwork->mac_address, ETH_ALEN)) {
struct wlan_network *ibss_wlan = NULL;
memcpy(pmlmepriv->cur_network.network.ies, pnetwork->ies, 8);
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
- ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->mac_address);
+ ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue,
+ pnetwork->mac_address);
if (ibss_wlan) {
memcpy(ibss_wlan->network.ies, pnetwork->ies, 8);
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
@@ -710,13 +732,18 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
} else {
u8 ret = _SUCCESS;
- struct wlan_bssid_ex *pdev_network = &adapter->registrypriv.dev_network;
+ struct wlan_bssid_ex *pdev_network =
+ &adapter->registrypriv.dev_network;
u8 *pibss = adapter->registrypriv.dev_network.mac_address;
- /* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;because don't set assoc_timer */
+ /* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
+ * because don't set assoc_timer
+ */
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
- memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
+ memcpy(&pdev_network->ssid,
+ &pmlmepriv->assoc_ssid,
+ sizeof(struct ndis_802_11_ssid));
rtw_update_registrypriv_dev_network(adapter);
rtw_generate_random_ibss(pibss);
@@ -743,8 +770,11 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
rtw_indicate_connect(adapter);
} else {
if (rtw_to_roam(adapter) != 0) {
- if (rtw_dec_to_roam(adapter) == 0
- || _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)
+ if (rtw_dec_to_roam(adapter) == 0 ||
+ _SUCCESS !=
+ rtw_sitesurvey_cmd(adapter,
+ &pmlmepriv->assoc_ssid,
+ 1, NULL, 0)
) {
rtw_set_to_roam(adapter, 0);
rtw_free_assoc_resources(adapter, 1);
@@ -763,8 +793,10 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
&& check_fwstate(pmlmepriv, _FW_LINKED)) {
if (rtw_select_roaming_candidate(pmlmepriv) == _SUCCESS) {
- receive_disconnect(adapter, pmlmepriv->cur_network.network.mac_address
- , WLAN_REASON_ACTIVE_ROAM);
+ receive_disconnect(adapter,
+ pmlmepriv->cur_network.network
+ .mac_address,
+ WLAN_REASON_ACTIVE_ROAM);
}
}
}
@@ -948,7 +980,8 @@ void rtw_scan_abort(struct adapter *adapter)
pmlmeext->scan_abort = false;
}
-static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, struct wlan_network *pnetwork)
+static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter,
+ struct wlan_network *pnetwork)
{
int i;
struct sta_info *bmc_sta, *psta = NULL;
@@ -1005,7 +1038,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
}
/* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */
- /* if A-MPDU Rx is enabled, resetting rx_ordering_ctrl wstart_b(indicate_seq) to default value = 0xffff */
+ /* if A-MPDU Rx is enabled, resetting rx_ordering_ctrl
+ * wstart_b(indicate_seq) to default value = 0xffff
+ */
/* todo: check if AP can send A-MPDU packets */
for (i = 0; i < 16 ; i++) {
preorder_ctrl = &psta->recvreorder_ctrl[i];
@@ -1022,7 +1057,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
preorder_ctrl->enable = false;
preorder_ctrl->indicate_seq = 0xffff;
preorder_ctrl->wend_b = 0xffff;
- preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
+ /* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
+ preorder_ctrl->wsize_b = 64;
}
}
}
@@ -1032,7 +1068,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
/* pnetwork : returns from rtw_joinbss_event_callback */
/* ptarget_wlan: found from scanned_queue */
-static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork)
+static void rtw_joinbss_update_network(struct adapter *padapter,
+ struct wlan_network *ptarget_wlan,
+ struct wlan_network *pnetwork)
{
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
struct wlan_network *cur_network = &pmlmepriv->cur_network;
@@ -1049,8 +1087,11 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
padapter->recvpriv.signal_strength = ptarget_wlan->network.phy_info.signal_strength;
padapter->recvpriv.signal_qual = ptarget_wlan->network.phy_info.signal_quality;
- /* the ptarget_wlan->network.rssi is raw data, we use ptarget_wlan->network.phy_info.signal_strength instead (has scaled) */
- padapter->recvpriv.rssi = translate_percentage_to_dbm(ptarget_wlan->network.phy_info.signal_strength);
+ /* the ptarget_wlan->network.rssi is raw data, we use
+ * ptarget_wlan->network.phy_info.signal_strength instead (has scaled)
+ */
+ padapter->recvpriv.rssi =
+ translate_percentage_to_dbm(ptarget_wlan->network.phy_info.signal_strength);
rtw_set_signal_stat_timer(&padapter->recvpriv);
@@ -1072,10 +1113,13 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
break;
}
- rtw_update_protection(padapter, (cur_network->network.ies) + sizeof(struct ndis_802_11_fix_ie),
- (cur_network->network.ie_length));
+ 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];
@@ -1095,9 +1139,12 @@ void rtw_reset_securitypriv(struct adapter *adapter)
/* We have to backup the PMK information for WiFi PMK Caching test item. */
/* */
/* Backup the btkip_countermeasure information. */
- /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
+ /* When the countermeasure is trigger, the driver have to disconnect
+ * with AP for 60 seconds.
+ */
- memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
+ memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0],
+ sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
@@ -1108,8 +1155,11 @@ void rtw_reset_securitypriv(struct adapter *adapter)
memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
/* Added by Albert 2009/02/18 */
- /* Restore the PMK information to securitypriv structure for the following connection. */
- memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
+ /* Restore the PMK information to securitypriv
+ * structure for the following connection.
+ */
+ memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0],
+ sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
@@ -1141,10 +1191,14 @@ void rtw_reset_securitypriv(struct adapter *adapter)
/* Notes: the function could be > passive_level (the same context as Rx tasklet) */
/* pnetwork : returns from rtw_joinbss_event_callback */
/* ptarget_wlan: found from scanned_queue */
-/* if join_res > 0, for (fw_state ==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */
+/* if join_res > 0, for (fw_state ==WIFI_STATION_STATE), we check
+ * if "ptarget_sta" & "ptarget_wlan" exist.
+ */
/* if join_res > 0, for (fw_state ==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */
-/* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan != NULL). */
-/* */
+/* if join_res > 0, update "cur_network->network" from "pnetwork->network"
+ * if (ptarget_wlan != NULL).
+ */
+
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
{
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
@@ -1155,7 +1209,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
unsigned int the_same_macaddr = false;
- the_same_macaddr = !memcmp(pnetwork->network.mac_address, cur_network->network.mac_address, ETH_ALEN);
+ the_same_macaddr = !memcmp(pnetwork->network.mac_address,
+ cur_network->network.mac_address, ETH_ALEN);
pnetwork->network.length = get_wlan_bssid_ex_sz(&pnetwork->network);
if (pnetwork->network.length > sizeof(struct wlan_bssid_ex))
@@ -1195,9 +1250,12 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
/* s1. find ptarget_wlan */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (the_same_macaddr) {
- ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
+ ptarget_wlan =
+ rtw_find_network(&pmlmepriv->scanned_queue,
+ cur_network->network.mac_address);
} else {
- pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
+ pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue,
+ cur_network->network.mac_address);
if (pcur_wlan)
pcur_wlan->fixed = false;
@@ -1205,7 +1263,9 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
if (pcur_sta)
rtw_free_stainfo(adapter, pcur_sta);
- ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.mac_address);
+ ptarget_wlan =
+ rtw_find_network(&pmlmepriv->scanned_queue,
+ pnetwork->network.mac_address);
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
if (ptarget_wlan)
ptarget_wlan->fixed = true;
@@ -1230,7 +1290,9 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
- /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */
+ /* s3. find ptarget_sta & update ptarget_sta after
+ * update cur_network only for station mode
+ */
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
if (!ptarget_sta) {
@@ -1298,7 +1360,8 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
/* report to upper layer */
spin_lock_bh(&psta->lock);
if (psta->passoc_req && psta->assoc_req_len > 0) {
- passoc_req = kmemdup(psta->passoc_req, psta->assoc_req_len, GFP_ATOMIC);
+ passoc_req = kmemdup(psta->passoc_req,
+ psta->assoc_req_len, GFP_ATOMIC);
if (passoc_req) {
assoc_req_len = psta->assoc_req_len;
@@ -1323,7 +1386,10 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
if (psta) {
/* the sta have been in sta_info_queue => do nothing */
- return; /* between drv has received this event before and fw have not yet to set key to CAM_ENTRY) */
+ /* between drv has received this event before and
+ * fw have not yet to set key to CAM_ENTRY)
+ */
+ return;
}
psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
@@ -1350,7 +1416,9 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
if (adapter->stapriv.asoc_sta_count == 2) {
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
- ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
+ ptarget_wlan =
+ rtw_find_network(&pmlmepriv->scanned_queue,
+ cur_network->network.mac_address);
pmlmepriv->cur_network_scanned = ptarget_wlan;
if (ptarget_wlan)
ptarget_wlan->fixed = true;
@@ -1407,16 +1475,19 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
if (adapter->registrypriv.wifi_spec == 1) {
roam = false;
- } else if (reason == WLAN_REASON_EXPIRATION_CHK && rtw_chk_roam_flags(adapter, RTW_ROAM_ON_EXPIRED)) {
+ } else if (reason == WLAN_REASON_EXPIRATION_CHK &&
+ rtw_chk_roam_flags(adapter, RTW_ROAM_ON_EXPIRED)) {
roam = true;
- } else if (reason == WLAN_REASON_ACTIVE_ROAM && rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
+ } else if (reason == WLAN_REASON_ACTIVE_ROAM &&
+ rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
roam = true;
roam_target = pmlmepriv->roam_network;
}
if (roam) {
if (rtw_to_roam(adapter) > 0)
- rtw_dec_to_roam(adapter); /* this stadel_event is caused by roaming, decrease to_roam */
+ /* this stadel_event is caused by roaming, decrease to_roam */
+ rtw_dec_to_roam(adapter);
else if (rtw_to_roam(adapter) == 0)
rtw_set_to_roam(adapter, adapter->registrypriv.max_roaming_times);
} else {
@@ -1430,7 +1501,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
/* remove the network entry in scanned_queue */
- pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
+ pwlan = rtw_find_network(&pmlmepriv->scanned_queue,
+ tgt_network->network.mac_address);
if (pwlan) {
pwlan->fixed = false;
rtw_free_network_nolock(adapter, pwlan);
@@ -1444,12 +1516,14 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
rtw_free_stainfo(adapter, psta);
- if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
+ /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
+ if (adapter->stapriv.asoc_sta_count == 1) {
u8 ret = _SUCCESS;
spin_lock_bh(&pmlmepriv->scanned_queue.lock);
/* free old ibss network */
- pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
+ pwlan = rtw_find_network(&pmlmepriv->scanned_queue,
+ tgt_network->network.mac_address);
if (pwlan) {
pwlan->fixed = false;
rtw_free_network_nolock(adapter, pwlan);
@@ -1459,9 +1533,11 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
pdev_network = &adapter->registrypriv.dev_network;
pibss = adapter->registrypriv.dev_network.mac_address;
- memcpy(pdev_network, &tgt_network->network, get_wlan_bssid_ex_sz(&tgt_network->network));
+ memcpy(pdev_network, &tgt_network->network,
+ get_wlan_bssid_ex_sz(&tgt_network->network));
- memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
+ memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid,
+ sizeof(struct ndis_802_11_ssid));
rtw_update_registrypriv_dev_network(adapter);
@@ -1530,9 +1606,11 @@ void _rtw_join_timeout_handler(struct timer_list *t)
} else {
rtw_indicate_disconnect(adapter);
- free_scanqueue(pmlmepriv);/* */
+ free_scanqueue(pmlmepriv);
- /* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */
+ /* indicate disconnect for the case that join_timeout and
+ * check_fwstate != FW_LINKED
+ */
rtw_cfg80211_indicate_disconnect(adapter);
}
@@ -1581,8 +1659,9 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
rtw_mlme_reset_auto_scan_int(padapter);
- if (pmlmepriv->auto_scan_int_ms != 0
- && jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
+ if (pmlmepriv->auto_scan_int_ms != 0 &&
+ jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) >
+ pmlmepriv->auto_scan_int_ms) {
if (!padapter->registrypriv.wifi_spec) {
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING))
goto exit;
@@ -1624,7 +1703,9 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter)
/* rtw_lps_ctrl_wk_cmd(adapter, LPS_CTRL_ENTER, 1); */
rtw_hal_dm_watchdog_in_lps(adapter);
} else {
- /* call rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1) in traffic_status_watchdog() */
+ /* call rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1) in
+ * traffic_status_watchdog()
+ */
}
} else {
@@ -1684,7 +1765,8 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
if (jiffies_to_msecs(jiffies - competitor->last_scanned) >= mlme->roam_scanr_exp_ms)
goto exit;
- if (competitor->network.rssi - mlme->cur_network_scanned->network.rssi < mlme->roam_rssi_diff_th)
+ if (competitor->network.rssi - mlme->cur_network_scanned->network.rssi <
+ mlme->roam_rssi_diff_th)
goto exit;
if (*candidate && (*candidate)->network.rssi >= competitor->network.rssi)
@@ -1757,8 +1839,10 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
/* check ssid, if needed */
if (mlme->assoc_ssid.ssid[0] && mlme->assoc_ssid.ssid_length) {
- if (competitor->network.ssid.ssid_length != mlme->assoc_ssid.ssid_length
- || memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid, mlme->assoc_ssid.ssid_length)
+ if (competitor->network.ssid.ssid_length !=
+ mlme->assoc_ssid.ssid_length ||
+ memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid,
+ mlme->assoc_ssid.ssid_length)
)
goto exit;
}
@@ -1876,7 +1960,9 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity
return res;
}
-signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, signed int keyid, u8 set_tx, bool enqueue)
+signed int rtw_set_key(struct adapter *adapter,
+ struct security_priv *psecuritypriv,
+ signed int keyid, u8 set_tx, bool enqueue)
{
u8 keylen;
struct cmd_obj *pcmd;
@@ -1951,7 +2037,8 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
}
/* adjust ies for rtw_joinbss_cmd in WMM */
-int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len)
+int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
+ uint in_len, uint initial_out_len)
{
unsigned int ielength = 0;
unsigned int i, j;
@@ -2055,7 +2142,8 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
wrqu.data.length = p - buff;
- wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
+ wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
+ wrqu.data.length : IW_CUSTOM_MAX;
kfree(buff);
}
@@ -2085,7 +2173,8 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
ielength += psecuritypriv->wps_ie_len;
} else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == WLAN_EID_RSN)) {
/* copy RSN or SSN */
- memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1] + 2);
+ memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0],
+ psecuritypriv->supplicant_ie[1] + 2);
ielength += psecuritypriv->supplicant_ie[1] + 2;
rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie);
}
@@ -2123,7 +2212,8 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
struct security_priv *psecuritypriv = &adapter->securitypriv;
struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
- pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */
+ /* adhoc no 802.1x */
+ pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0);
pdev_network->rssi = 0;
@@ -2153,14 +2243,19 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
/* 1. Supported rates */
/* 2. IE */
- /* rtw_set_supported_rate(pdev_network->supported_rates, pregistrypriv->wireless_mode) ; will be called in rtw_generate_ie */
+ /* rtw_set_supported_rate(pdev_network->supported_rates,
+ * pregistrypriv->wireless_mode);
+ * will be called in rtw_generate_ie
+ */
sz = rtw_generate_ie(pregistrypriv);
pdev_network->ie_length = sz;
pdev_network->length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
- /* notes: translate ie_length & length after assign the length to cmdsz in createbss_cmd(); */
+ /* notes: translate ie_length & length after assign the
+ * length to cmdsz in createbss_cmd();
+ */
/* pdev_network->ie_length = cpu_to_le32(sz); */
}
@@ -2172,7 +2267,9 @@ void rtw_joinbss_reset(struct adapter *padapter)
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
- /* todo: if you want to do something io/reg/hw setting before join_bss, please add code here */
+ /* todo: if you want to do something io/reg/hw setting before join_bss,
+ * please add code here
+ */
pmlmepriv->num_FortyMHzIntolerant = 0;
@@ -2262,7 +2359,9 @@ void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len)
}
/* the function is >= passive_level */
-unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel)
+unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie,
+ u8 *out_ie, uint in_len,
+ uint *pout_len, u8 channel)
{
u32 ielen, out_len;
enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor;
@@ -2343,7 +2442,8 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
/* update default supported_mcs_set */
if (stbc_rx_enable)
- ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_RX_STBC_1R);/* RX STBC One spatial stream */
+ /* RX STBC One spatial stream */
+ ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_RX_STBC_1R);
set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_1R);
@@ -2409,7 +2509,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
/* check Max Rx A-MPDU Size */
len = 0;
- p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_CAPABILITY, &len, ie_len - sizeof(struct ndis_802_11_fix_ie));
+ p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie),
+ WLAN_EID_HT_CAPABILITY, &len,
+ ie_len - sizeof(struct ndis_802_11_fix_ie));
if (p && len > 0) {
pht_capie = (struct ieee80211_ht_cap *)(p + 2);
max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
@@ -2419,7 +2521,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
}
len = 0;
- p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_OPERATION, &len, ie_len - sizeof(struct ndis_802_11_fix_ie));
+ p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie),
+ WLAN_EID_HT_OPERATION, &len,
+ ie_len - sizeof(struct ndis_802_11_fix_ie));
if (p && len > 0) {
/* todo: */
}
@@ -2435,7 +2539,8 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
/* update the MCS set */
for (i = 0; i < 16; i++)
- pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= pmlmeext->default_supported_mcs_set[i];
+ pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &=
+ pmlmeext->default_supported_mcs_set[i];
/* update the MCS rates */
set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_1R);
@@ -2552,7 +2657,8 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
struct wlan_network *cur_network = &pmlmepriv->cur_network;
if (rtw_to_roam(padapter) > 0) {
- memcpy(&pmlmepriv->assoc_ssid, &cur_network->network.ssid, sizeof(struct ndis_802_11_ssid));
+ memcpy(&pmlmepriv->assoc_ssid, &cur_network->network.ssid,
+ sizeof(struct ndis_802_11_ssid));
pmlmepriv->assoc_by_bssid = false;
--
2.54.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: rtl8723bs: rtw_mlme: fix line length warnings
2026-04-24 21:16 [PATCH] staging: rtl8723bs: rtw_mlme: fix line length warnings Salman Alghamdi
@ 2026-04-25 12:45 ` Luka Gejak
0 siblings, 0 replies; 2+ messages in thread
From: Luka Gejak @ 2026-04-25 12:45 UTC (permalink / raw)
To: Salman Alghamdi, gregkh; +Cc: straube.linux, linux-staging, linux-kernel
On Fri Apr 24, 2026 at 11:16 PM CEST, Salman Alghamdi wrote:
> Fix lines exceeding 100 columns in rtw_mlme.c as flagged by
> checkpatch.pl. Wrap long function signatures, function calls,
> assignments, and block comments to bring all lines within the
> 100 column limit.
>
> Signed-off-by: Salman Alghamdi <me@cipherat.com>
> ---
> drivers/staging/rtl8723bs/core/rtw_mlme.c | 258 +++++++++++++++-------
> 1 file changed, 182 insertions(+), 76 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index ddfc56f0253d..fe996484a6ed 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -52,7 +52,10 @@ int rtw_init_mlme_priv(struct adapter *padapter)
> pmlmepriv->pscanned = NULL;
> pmlmepriv->fw_state = WIFI_STATION_STATE; /* Must sync with rtw_wdev_alloc() */
> pmlmepriv->cur_network.network.infrastructure_mode = Ndis802_11AutoUnknown;
> - pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
> + /* 1: active, 0: passive. Maybe someday we should rename this
> + * variable to "active_mode" (Jeff)
> + */
> + pmlmepriv->scan_mode = SCAN_ACTIVE;
>
> spin_lock_init(&pmlmepriv->lock);
> INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
> @@ -125,7 +128,8 @@ void rtw_free_mlme_priv_ie_data(struct mlme_priv *pmlmepriv)
> rtw_free_mlme_ie_data(&pmlmepriv->p2p_beacon_ie, &pmlmepriv->p2p_beacon_ie_len);
> rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_req_ie, &pmlmepriv->p2p_probe_req_ie_len);
> rtw_free_mlme_ie_data(&pmlmepriv->p2p_probe_resp_ie, &pmlmepriv->p2p_probe_resp_ie_len);
> - rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie, &pmlmepriv->p2p_go_probe_resp_ie_len);
> + rtw_free_mlme_ie_data(&pmlmepriv->p2p_go_probe_resp_ie,
> + &pmlmepriv->p2p_go_probe_resp_ie_len);
> rtw_free_mlme_ie_data(&pmlmepriv->p2p_assoc_req_ie, &pmlmepriv->p2p_assoc_req_ie_len);
> }
>
> @@ -369,7 +373,8 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea
> (d_cap & WLAN_CAPABILITY_ESS));
> }
>
> -struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network)
> +struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue,
> + struct wlan_network *network)
^^^^
This alignment is wrong please align struct with struct from line above.
> {
> struct list_head *phead, *plist;
> struct wlan_network *found = NULL;
> @@ -420,7 +425,8 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
> long rssi_final;
>
> /* The rule below is 1/5 for sample value, 4/5 for history value */
> - if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) && is_same_network(&padapter->mlmepriv.cur_network.network, src, 0)) {
> + if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) &&
> + is_same_network(&padapter->mlmepriv.cur_network.network, src, 0)) {
> /* Take the recvpriv's value for the connected AP*/
> ss_final = padapter->recvpriv.signal_strength;
> sq_final = padapter->recvpriv.signal_qual;
> @@ -431,11 +437,15 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
> rssi_final = rssi_ori;
> } else {
> if (sq_smp != 101) { /* from the right channel */
> - ss_final = ((u32)(src->phy_info.signal_strength) + (u32)(dst->phy_info.signal_strength) * 4) / 5;
> - sq_final = ((u32)(src->phy_info.signal_quality) + (u32)(dst->phy_info.signal_quality) * 4) / 5;
> + ss_final = ((u32)(src->phy_info.signal_strength) +
> + (u32)(dst->phy_info.signal_strength) * 4) / 5;
> + sq_final = ((u32)(src->phy_info.signal_quality) +
> + (u32)(dst->phy_info.signal_quality) * 4) / 5;
> rssi_final = (src->rssi + dst->rssi * 4) / 5;
> } else {
> - /* bss info not receiving from the right channel, use the original RX signal infos */
> + /* bss info not receiving from the right channel,
> + * use the original RX signal infos
> + */
> ss_final = dst->phy_info.signal_strength;
> sq_final = dst->phy_info.signal_quality;
> rssi_final = dst->rssi;
> @@ -462,10 +472,13 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
> &pmlmepriv->cur_network.network,
> &pmlmepriv->cur_network.network);
>
> - if (check_fwstate(pmlmepriv, _FW_LINKED) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
> + if (check_fwstate(pmlmepriv, _FW_LINKED) &&
> + (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
> update_network(&pmlmepriv->cur_network.network, pnetwork, adapter, true);
> - rtw_update_protection(adapter, (pmlmepriv->cur_network.network.ies) + sizeof(struct ndis_802_11_fix_ie),
> - pmlmepriv->cur_network.network.ie_length);
> + rtw_update_protection(adapter,
> + (pmlmepriv->cur_network.network.ies) +
> + sizeof(struct ndis_802_11_fix_ie),
You shouldn't break an arithmetic operation onto a new line. The
preferred way to do this is to create a local variable to simplify the
arguments and reduce the line length.
> + pmlmepriv->cur_network.network.ie_length);
> }
> }
>
> @@ -601,7 +614,10 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
> privacy = pnetwork->network.privacy;
>
> if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
> - if (rtw_get_wps_ie(pnetwork->network.ies + _FIXED_IE_LENGTH_, pnetwork->network.ie_length - _FIXED_IE_LENGTH_, NULL, &wps_ielen))
> + if (rtw_get_wps_ie(pnetwork->network.ies +
> + _FIXED_IE_LENGTH_,
Again, please avoid breaking arithmetic operations across lines (e.g.
the addition of _FIXED_IE_LENGTH_). Use local variables to store the
calculated ie pointer and length before calling the function.
> + pnetwork->network.ie_length - _FIXED_IE_LENGTH_,
Similarly, the subtraction pnetwork->network.ie_length - _FIXED_IE_LENGTH_
should also be moved to a local variable.
> + NULL, &wps_ielen))
^^^^
The alignment here is also wrong. Arguments on wrapped lines should be
vertically aligned with the first argument of the function call. In this
case, the N in NULL should align with the p of the first pnetwork
argument.
> return true;
> else
> return false;
> @@ -614,7 +630,10 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
> bselected = false;
>
> if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) {
> - p = rtw_get_ie(pnetwork->network.ies + _BEACON_IE_OFFSET_, WLAN_EID_RSN, &ie_len, (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
> + p = rtw_get_ie(pnetwork->network.ies +
> + _BEACON_IE_OFFSET_,
Same here, the addition should also be moved to a local variable.
> + WLAN_EID_RSN, &ie_len,
> + (pnetwork->network.ie_length - _BEACON_IE_OFFSET_));
^^^^^
This subtraction should be moved to a local variable as well.
> if (p && ie_len > 0)
> bselected = true;
> else
> @@ -626,7 +645,8 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
> bselected = false;
>
> if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
> - if (pnetwork->network.infrastructure_mode != pmlmepriv->cur_network.network.infrastructure_mode)
> + if (pnetwork->network.infrastructure_mode !=
> + pmlmepriv->cur_network.network.infrastructure_mode)
> bselected = false;
> }
>
> @@ -654,12 +674,14 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
>
> /* update IBSS_network 's timestamp */
> if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
> - if (!memcmp(&pmlmepriv->cur_network.network.mac_address, pnetwork->mac_address, ETH_ALEN)) {
> + if (!memcmp(&pmlmepriv->cur_network.network.mac_address,
> + pnetwork->mac_address, ETH_ALEN)) {
> struct wlan_network *ibss_wlan = NULL;
>
> memcpy(pmlmepriv->cur_network.network.ies, pnetwork->ies, 8);
> spin_lock_bh(&pmlmepriv->scanned_queue.lock);
> - ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->mac_address);
> + ibss_wlan = rtw_find_network(&pmlmepriv->scanned_queue,
> + pnetwork->mac_address);
> if (ibss_wlan) {
> memcpy(ibss_wlan->network.ies, pnetwork->ies, 8);
> spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
> @@ -710,13 +732,18 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
> _set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
> } else {
> u8 ret = _SUCCESS;
> - struct wlan_bssid_ex *pdev_network = &adapter->registrypriv.dev_network;
> + struct wlan_bssid_ex *pdev_network =
> + &adapter->registrypriv.dev_network;
At this indentation level (5 tabs), the line reaches 112 characters,
which exceeds the 100-character limit. However, breaking the assignment
across two lines makes it hard to read. Please use a local variable to
shorten the path to dev_network instead.
> u8 *pibss = adapter->registrypriv.dev_network.mac_address;
>
> - /* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;because don't set assoc_timer */
> + /* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;
> + * because don't set assoc_timer
> + */
It would be preferable to remove the dead code in a separate patch
instead of continuing to maintain it.
> _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
>
> - memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
> + memcpy(&pdev_network->ssid,
> + &pmlmepriv->assoc_ssid,
> + sizeof(struct ndis_802_11_ssid));
>
> rtw_update_registrypriv_dev_network(adapter);
> rtw_generate_random_ibss(pibss);
> @@ -743,8 +770,11 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
> rtw_indicate_connect(adapter);
> } else {
> if (rtw_to_roam(adapter) != 0) {
> - if (rtw_dec_to_roam(adapter) == 0
> - || _SUCCESS != rtw_sitesurvey_cmd(adapter, &pmlmepriv->assoc_ssid, 1, NULL, 0)
> + if (rtw_dec_to_roam(adapter) == 0 ||
> + _SUCCESS !=
> + rtw_sitesurvey_cmd(adapter,
> + &pmlmepriv->assoc_ssid,
> + 1, NULL, 0)
This alignment is very poor and significantly hurts readability. You
shouldn't break comparison operators (like !=) across lines, nor should
you spread a single function call across so many lines at this
indentation depth. Please use a local variable to capture the return
value of rtw_sitesurvey_cmd() first. This will allow the if statement to
stay on one or two clear lines.
> ) {
> rtw_set_to_roam(adapter, 0);
> rtw_free_assoc_resources(adapter, 1);
> @@ -763,8 +793,10 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
> if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
> && check_fwstate(pmlmepriv, _FW_LINKED)) {
> if (rtw_select_roaming_candidate(pmlmepriv) == _SUCCESS) {
> - receive_disconnect(adapter, pmlmepriv->cur_network.network.mac_address
> - , WLAN_REASON_ACTIVE_ROAM);
> + receive_disconnect(adapter,
> + pmlmepriv->cur_network.network
> + .mac_address,
> + WLAN_REASON_ACTIVE_ROAM);
You should never break a structure member access across lines. Please
use a local variable to shorten the path to the mac address. This will
allow the function call to fit on a single line or be wrapped cleanly
without breaking the structure access.
> }
> }
> }
> @@ -948,7 +980,8 @@ void rtw_scan_abort(struct adapter *adapter)
> pmlmeext->scan_abort = false;
> }
>
> -static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, struct wlan_network *pnetwork)
> +static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter,
> + struct wlan_network *pnetwork)
^^^^
This alignment is bad. Please aling struct with struct from line above.
> {
> int i;
> struct sta_info *bmc_sta, *psta = NULL;
> @@ -1005,7 +1038,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
> }
>
> /* for A-MPDU Rx reordering buffer control for bmc_sta & sta_info */
> - /* if A-MPDU Rx is enabled, resetting rx_ordering_ctrl wstart_b(indicate_seq) to default value = 0xffff */
> + /* if A-MPDU Rx is enabled, resetting rx_ordering_ctrl
> + * wstart_b(indicate_seq) to default value = 0xffff
> + */
> /* todo: check if AP can send A-MPDU packets */
> for (i = 0; i < 16 ; i++) {
> preorder_ctrl = &psta->recvreorder_ctrl[i];
> @@ -1022,7 +1057,8 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
> preorder_ctrl->enable = false;
> preorder_ctrl->indicate_seq = 0xffff;
> preorder_ctrl->wend_b = 0xffff;
> - preorder_ctrl->wsize_b = 64;/* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
> + /* max_ampdu_sz;ex. 32(kbytes) -> wsize_b =32 */
> + preorder_ctrl->wsize_b = 64;
> }
> }
> }
> @@ -1032,7 +1068,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
>
> /* pnetwork : returns from rtw_joinbss_event_callback */
> /* ptarget_wlan: found from scanned_queue */
> -static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork)
> +static void rtw_joinbss_update_network(struct adapter *padapter,
> + struct wlan_network *ptarget_wlan,
> + struct wlan_network *pnetwork)
^^^^^
This alignment isn't good either. Please aling structs with word struct
from first argument.
> {
> struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
> struct wlan_network *cur_network = &pmlmepriv->cur_network;
> @@ -1049,8 +1087,11 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
>
> padapter->recvpriv.signal_strength = ptarget_wlan->network.phy_info.signal_strength;
> padapter->recvpriv.signal_qual = ptarget_wlan->network.phy_info.signal_quality;
> - /* the ptarget_wlan->network.rssi is raw data, we use ptarget_wlan->network.phy_info.signal_strength instead (has scaled) */
> - padapter->recvpriv.rssi = translate_percentage_to_dbm(ptarget_wlan->network.phy_info.signal_strength);
> + /* the ptarget_wlan->network.rssi is raw data, we use
> + * ptarget_wlan->network.phy_info.signal_strength instead (has scaled)
> + */
> + padapter->recvpriv.rssi =
> + translate_percentage_to_dbm(ptarget_wlan->network.phy_info.signal_strength);
Please avoid breaking the assignment across two lines. Instead, consider
using a local variable to shorten the function argument path, or a
shorthand for the padapter->recvpriv pointer. This would allow the
assignment to fit on a single line, improving readability.
>
> rtw_set_signal_stat_timer(&padapter->recvpriv);
>
> @@ -1072,10 +1113,13 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
> break;
> }
>
> - rtw_update_protection(padapter, (cur_network->network.ies) + sizeof(struct ndis_802_11_fix_ie),
> - (cur_network->network.ie_length));
> + rtw_update_protection(padapter, (cur_network->network.ies) +
> + sizeof(struct ndis_802_11_fix_ie),
> + (cur_network->network.ie_length));
^^^^ - Misaligned
As mentioned previously, please don't break arithmetic operations
across lines. Additionally, the indentation here is inconsistent and
doesn't follow the standard vertical alignment. Please use a local
variable to store the ie pointer and fix alignment. This will allow the
function call to fit on a single line.
>
> - 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];
> @@ -1095,9 +1139,12 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> /* We have to backup the PMK information for WiFi PMK Caching test item. */
> /* */
> /* Backup the btkip_countermeasure information. */
> - /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
> + /* When the countermeasure is trigger, the driver have to disconnect
> + * with AP for 60 seconds.
^^^^
w should be alinged with W from line above.
> + */
>
> - memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
> + memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0],
> + sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
> backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
> backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
> backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time;
> @@ -1108,8 +1155,11 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv));
>
> /* Added by Albert 2009/02/18 */
> - /* Restore the PMK information to securitypriv structure for the following connection. */
> - memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0], sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
> + /* Restore the PMK information to securitypriv
> + * structure for the following connection.
^^^^
s should be aligned with R from Restore on line above.
> + */
> + memcpy(&adapter->securitypriv.PMKIDList[0], &backupPMKIDList[0],
> + sizeof(struct rt_pmkid_list) * NUM_PMKID_CACHE);
> adapter->securitypriv.PMKIDIndex = backupPMKIDIndex;
> adapter->securitypriv.btkip_countermeasure = backupTKIPCountermeasure;
> adapter->securitypriv.btkip_countermeasure_time = backupTKIPcountermeasure_time;
> @@ -1141,10 +1191,14 @@ void rtw_reset_securitypriv(struct adapter *adapter)
> /* Notes: the function could be > passive_level (the same context as Rx tasklet) */
> /* pnetwork : returns from rtw_joinbss_event_callback */
> /* ptarget_wlan: found from scanned_queue */
> -/* if join_res > 0, for (fw_state ==WIFI_STATION_STATE), we check if "ptarget_sta" & "ptarget_wlan" exist. */
> +/* if join_res > 0, for (fw_state ==WIFI_STATION_STATE), we check
> + * if "ptarget_sta" & "ptarget_wlan" exist.
> + */
> /* if join_res > 0, for (fw_state ==WIFI_ADHOC_STATE), we only check if "ptarget_wlan" exist. */
> -/* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan != NULL). */
> -/* */
> +/* if join_res > 0, update "cur_network->network" from "pnetwork->network"
> + * if (ptarget_wlan != NULL).
> + */
> +
> void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
> {
> struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
> @@ -1155,7 +1209,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
> struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
> unsigned int the_same_macaddr = false;
>
> - the_same_macaddr = !memcmp(pnetwork->network.mac_address, cur_network->network.mac_address, ETH_ALEN);
> + the_same_macaddr = !memcmp(pnetwork->network.mac_address,
> + cur_network->network.mac_address, ETH_ALEN);
>
> pnetwork->network.length = get_wlan_bssid_ex_sz(&pnetwork->network);
> if (pnetwork->network.length > sizeof(struct wlan_bssid_ex))
> @@ -1195,9 +1250,12 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
> /* s1. find ptarget_wlan */
> if (check_fwstate(pmlmepriv, _FW_LINKED)) {
> if (the_same_macaddr) {
> - ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
> + ptarget_wlan =
> + rtw_find_network(&pmlmepriv->scanned_queue,
> + cur_network->network.mac_address);
Again, use a local variable to shorten the function arguments rather
than splitting the assignment.
> } else {
> - pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
> + pcur_wlan = rtw_find_network(&pmlmepriv->scanned_queue,
> + cur_network->network.mac_address);
> if (pcur_wlan)
> pcur_wlan->fixed = false;
>
> @@ -1205,7 +1263,9 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
> if (pcur_sta)
> rtw_free_stainfo(adapter, pcur_sta);
>
> - ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.mac_address);
> + ptarget_wlan =
> + rtw_find_network(&pmlmepriv->scanned_queue,
> + pnetwork->network.mac_address);
Same here as above.
> if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
> if (ptarget_wlan)
> ptarget_wlan->fixed = true;
> @@ -1230,7 +1290,9 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
>
> rtw_joinbss_update_network(adapter, ptarget_wlan, pnetwork);
>
> - /* s3. find ptarget_sta & update ptarget_sta after update cur_network only for station mode */
> + /* s3. find ptarget_sta & update ptarget_sta after
> + * update cur_network only for station mode
> + */
> if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
> ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
> if (!ptarget_sta) {
> @@ -1298,7 +1360,8 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
> /* report to upper layer */
> spin_lock_bh(&psta->lock);
> if (psta->passoc_req && psta->assoc_req_len > 0) {
> - passoc_req = kmemdup(psta->passoc_req, psta->assoc_req_len, GFP_ATOMIC);
> + passoc_req = kmemdup(psta->passoc_req,
> + psta->assoc_req_len, GFP_ATOMIC);
> if (passoc_req) {
> assoc_req_len = psta->assoc_req_len;
>
> @@ -1323,7 +1386,10 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
> if (psta) {
> /* the sta have been in sta_info_queue => do nothing */
>
> - return; /* between drv has received this event before and fw have not yet to set key to CAM_ENTRY) */
> + /* between drv has received this event before and
> + * fw have not yet to set key to CAM_ENTRY)
> + */
> + return;
> }
>
> psta = rtw_alloc_stainfo(&adapter->stapriv, pstassoc->macaddr);
> @@ -1350,7 +1416,9 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
> check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
> if (adapter->stapriv.asoc_sta_count == 2) {
> spin_lock_bh(&pmlmepriv->scanned_queue.lock);
> - ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, cur_network->network.mac_address);
> + ptarget_wlan =
> + rtw_find_network(&pmlmepriv->scanned_queue,
> + cur_network->network.mac_address);
Again, same as above.
> pmlmepriv->cur_network_scanned = ptarget_wlan;
> if (ptarget_wlan)
> ptarget_wlan->fixed = true;
> @@ -1407,16 +1475,19 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
>
> if (adapter->registrypriv.wifi_spec == 1) {
> roam = false;
> - } else if (reason == WLAN_REASON_EXPIRATION_CHK && rtw_chk_roam_flags(adapter, RTW_ROAM_ON_EXPIRED)) {
> + } else if (reason == WLAN_REASON_EXPIRATION_CHK &&
> + rtw_chk_roam_flags(adapter, RTW_ROAM_ON_EXPIRED)) {
> roam = true;
> - } else if (reason == WLAN_REASON_ACTIVE_ROAM && rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
> + } else if (reason == WLAN_REASON_ACTIVE_ROAM &&
> + rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
> roam = true;
> roam_target = pmlmepriv->roam_network;
> }
>
> if (roam) {
> if (rtw_to_roam(adapter) > 0)
> - rtw_dec_to_roam(adapter); /* this stadel_event is caused by roaming, decrease to_roam */
> + /* this stadel_event is caused by roaming, decrease to_roam */
> + rtw_dec_to_roam(adapter);
> else if (rtw_to_roam(adapter) == 0)
> rtw_set_to_roam(adapter, adapter->registrypriv.max_roaming_times);
> } else {
> @@ -1430,7 +1501,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
>
> spin_lock_bh(&pmlmepriv->scanned_queue.lock);
> /* remove the network entry in scanned_queue */
> - pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
> + pwlan = rtw_find_network(&pmlmepriv->scanned_queue,
> + tgt_network->network.mac_address);
> if (pwlan) {
> pwlan->fixed = false;
> rtw_free_network_nolock(adapter, pwlan);
> @@ -1444,12 +1516,14 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
> check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
> rtw_free_stainfo(adapter, psta);
>
> - if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
> + /* a sta + bc/mc_stainfo (not Ibss_stainfo) */
> + if (adapter->stapriv.asoc_sta_count == 1) {
> u8 ret = _SUCCESS;
>
> spin_lock_bh(&pmlmepriv->scanned_queue.lock);
> /* free old ibss network */
> - pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
> + pwlan = rtw_find_network(&pmlmepriv->scanned_queue,
> + tgt_network->network.mac_address);
> if (pwlan) {
> pwlan->fixed = false;
> rtw_free_network_nolock(adapter, pwlan);
> @@ -1459,9 +1533,11 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
> pdev_network = &adapter->registrypriv.dev_network;
> pibss = adapter->registrypriv.dev_network.mac_address;
>
> - memcpy(pdev_network, &tgt_network->network, get_wlan_bssid_ex_sz(&tgt_network->network));
> + memcpy(pdev_network, &tgt_network->network,
> + get_wlan_bssid_ex_sz(&tgt_network->network));
>
> - memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
> + memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid,
> + sizeof(struct ndis_802_11_ssid));
>
> rtw_update_registrypriv_dev_network(adapter);
>
> @@ -1530,9 +1606,11 @@ void _rtw_join_timeout_handler(struct timer_list *t)
>
> } else {
> rtw_indicate_disconnect(adapter);
> - free_scanqueue(pmlmepriv);/* */
> + free_scanqueue(pmlmepriv);
>
> - /* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */
> + /* indicate disconnect for the case that join_timeout and
> + * check_fwstate != FW_LINKED
> + */
> rtw_cfg80211_indicate_disconnect(adapter);
> }
>
> @@ -1581,8 +1659,9 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
>
> rtw_mlme_reset_auto_scan_int(padapter);
>
> - if (pmlmepriv->auto_scan_int_ms != 0
> - && jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
> + if (pmlmepriv->auto_scan_int_ms != 0 &&
> + jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) >
> + pmlmepriv->auto_scan_int_ms) {
^^^^
Please don't break the line at the comparison operator. It is better to
use a local variable to calculate the elapsed time before the if
statement. This would simplify the condition and keep the logic on a
single line.
> if (!padapter->registrypriv.wifi_spec) {
> if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING))
> goto exit;
> @@ -1624,7 +1703,9 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter)
> /* rtw_lps_ctrl_wk_cmd(adapter, LPS_CTRL_ENTER, 1); */
> rtw_hal_dm_watchdog_in_lps(adapter);
> } else {
> - /* call rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1) in traffic_status_watchdog() */
> + /* call rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1) in
> + * traffic_status_watchdog()
> + */
> }
>
> } else {
> @@ -1684,7 +1765,8 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
> if (jiffies_to_msecs(jiffies - competitor->last_scanned) >= mlme->roam_scanr_exp_ms)
> goto exit;
>
> - if (competitor->network.rssi - mlme->cur_network_scanned->network.rssi < mlme->roam_rssi_diff_th)
> + if (competitor->network.rssi - mlme->cur_network_scanned->network.rssi <
> + mlme->roam_rssi_diff_th)
If you introduce local variable for subtraction comparison will fit on
same line without exceeding the limit.
> goto exit;
>
> if (*candidate && (*candidate)->network.rssi >= competitor->network.rssi)
> @@ -1757,8 +1839,10 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
>
> /* check ssid, if needed */
> if (mlme->assoc_ssid.ssid[0] && mlme->assoc_ssid.ssid_length) {
> - if (competitor->network.ssid.ssid_length != mlme->assoc_ssid.ssid_length
> - || memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid, mlme->assoc_ssid.ssid_length)
> + if (competitor->network.ssid.ssid_length !=
> + mlme->assoc_ssid.ssid_length ||
> + memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid,
> + mlme->assoc_ssid.ssid_length)
Again, please don't break the comparison operator across lines.
Furthermore, this nested logic is becoming difficult to read due to the
long variable paths. It would be much better to use local variables for
the ssid lengths and the ssid pointers. This would allow the if
condition to be much cleaner and fit on fewer lines.
> )
> goto exit;
> }
> @@ -1876,7 +1960,9 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity
> return res;
> }
>
> -signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecuritypriv, signed int keyid, u8 set_tx, bool enqueue)
> +signed int rtw_set_key(struct adapter *adapter,
> + struct security_priv *psecuritypriv,
> + signed int keyid, u8 set_tx, bool enqueue)
^^^^^
This is misaligned. Words struct should align with word struct from
first argument.
> {
> u8 keylen;
> struct cmd_obj *pcmd;
> @@ -1951,7 +2037,8 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
> }
>
> /* adjust ies for rtw_joinbss_cmd in WMM */
> -int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len)
> +int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie,
> + uint in_len, uint initial_out_len)
^^^^^
This is misaligned too u from uint should align with struct from first
argument.
> {
> unsigned int ielength = 0;
> unsigned int i, j;
> @@ -2055,7 +2142,8 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
>
> wrqu.data.length = p - buff;
>
> - wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length : IW_CUSTOM_MAX;
> + wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ?
> + wrqu.data.length : IW_CUSTOM_MAX;
Please avoid breaking the ternary operator across lines like this. If
the line is too long, it is usually cleaner to use the min() or clamp()
macro, which is the standard way to handle cap logic in the linux
kernel. This would keep the assignment on a single line and make the
intent much clearer.
>
> kfree(buff);
> }
> @@ -2085,7 +2173,8 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
> ielength += psecuritypriv->wps_ie_len;
> } else if ((authmode == WLAN_EID_VENDOR_SPECIFIC) || (authmode == WLAN_EID_RSN)) {
> /* copy RSN or SSN */
> - memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0], psecuritypriv->supplicant_ie[1] + 2);
> + memcpy(&out_ie[ielength], &psecuritypriv->supplicant_ie[0],
> + psecuritypriv->supplicant_ie[1] + 2);
> ielength += psecuritypriv->supplicant_ie[1] + 2;
> rtw_report_sec_ie(adapter, authmode, psecuritypriv->supplicant_ie);
> }
> @@ -2123,7 +2212,8 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
> struct security_priv *psecuritypriv = &adapter->securitypriv;
> struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
>
> - pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */
> + /* adhoc no 802.1x */
> + pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0);
>
> pdev_network->rssi = 0;
>
> @@ -2153,14 +2243,19 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
> /* 1. Supported rates */
> /* 2. IE */
>
> - /* rtw_set_supported_rate(pdev_network->supported_rates, pregistrypriv->wireless_mode) ; will be called in rtw_generate_ie */
> + /* rtw_set_supported_rate(pdev_network->supported_rates,
> + * pregistrypriv->wireless_mode);
> + * will be called in rtw_generate_ie
> + */
Again, dead code.
> sz = rtw_generate_ie(pregistrypriv);
>
> pdev_network->ie_length = sz;
>
> pdev_network->length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
>
> - /* notes: translate ie_length & length after assign the length to cmdsz in createbss_cmd(); */
> + /* notes: translate ie_length & length after assign the
> + * length to cmdsz in createbss_cmd();
> + */
> /* pdev_network->ie_length = cpu_to_le32(sz); */
> }
>
> @@ -2172,7 +2267,9 @@ void rtw_joinbss_reset(struct adapter *padapter)
>
> struct ht_priv *phtpriv = &pmlmepriv->htpriv;
>
> - /* todo: if you want to do something io/reg/hw setting before join_bss, please add code here */
> + /* todo: if you want to do something io/reg/hw setting before join_bss,
> + * please add code here
> + */
>
> pmlmepriv->num_FortyMHzIntolerant = 0;
>
> @@ -2262,7 +2359,9 @@ void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len)
> }
>
> /* the function is >= passive_level */
> -unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len, u8 channel)
> +unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie,
> + u8 *out_ie, uint in_len,
> + uint *pout_len, u8 channel)
^^^^^
Wrong alignment here too. u in u8 and u in uint should be aligned with
struct in first argument.
> {
> u32 ielen, out_len;
> enum ieee80211_max_ampdu_length_exp max_rx_ampdu_factor;
> @@ -2343,7 +2442,8 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
>
> /* update default supported_mcs_set */
> if (stbc_rx_enable)
> - ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_RX_STBC_1R);/* RX STBC One spatial stream */
> + /* RX STBC One spatial stream */
> + ht_capie.cap_info |= cpu_to_le16(IEEE80211_HT_CAP_RX_STBC_1R);
>
> set_mcs_rate_by_mask(ht_capie.mcs.rx_mask, MCS_RATE_1R);
>
> @@ -2409,7 +2509,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
>
> /* check Max Rx A-MPDU Size */
> len = 0;
> - p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_CAPABILITY, &len, ie_len - sizeof(struct ndis_802_11_fix_ie));
> + p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie),
> + WLAN_EID_HT_CAPABILITY, &len,
> + ie_len - sizeof(struct ndis_802_11_fix_ie));
> if (p && len > 0) {
> pht_capie = (struct ieee80211_ht_cap *)(p + 2);
> max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
> @@ -2419,7 +2521,9 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
> }
>
> len = 0;
> - p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie), WLAN_EID_HT_OPERATION, &len, ie_len - sizeof(struct ndis_802_11_fix_ie));
> + p = rtw_get_ie(pie + sizeof(struct ndis_802_11_fix_ie),
> + WLAN_EID_HT_OPERATION, &len,
> + ie_len - sizeof(struct ndis_802_11_fix_ie));
> if (p && len > 0) {
> /* todo: */
> }
> @@ -2435,7 +2539,8 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
>
> /* update the MCS set */
> for (i = 0; i < 16; i++)
> - pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= pmlmeext->default_supported_mcs_set[i];
> + pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &=
> + pmlmeext->default_supported_mcs_set[i];
Please don't break the line at the compound assignment operator either.
This makes the logic harder to follow. Instead, use a local variable to
shorten the long structure path on the left-hand side. This will allow
the entire operation to fit on one line.
>
> /* update the MCS rates */
> set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_1R);
> @@ -2552,7 +2657,8 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
> struct wlan_network *cur_network = &pmlmepriv->cur_network;
>
> if (rtw_to_roam(padapter) > 0) {
> - memcpy(&pmlmepriv->assoc_ssid, &cur_network->network.ssid, sizeof(struct ndis_802_11_ssid));
> + memcpy(&pmlmepriv->assoc_ssid, &cur_network->network.ssid,
> + sizeof(struct ndis_802_11_ssid));
>
> pmlmepriv->assoc_by_bssid = false;
>
Please send v2 with mentioned changes.
Best regards,
Luka Gejak
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-25 12:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 21:16 [PATCH] staging: rtl8723bs: rtw_mlme: fix line length warnings Salman Alghamdi
2026-04-25 12:45 ` Luka Gejak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox