linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability
@ 2025-07-26  4:31 Vivek BalachandharTN
  2025-07-26  4:31 ` [PATCH 01/20] staging: rtl8723bs: fix spacing around operators Vivek BalachandharTN
                   ` (20 more replies)
  0 siblings, 21 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:31 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

This patch series includes 20 commits that clean up and improve
the style and formatting of the rtl8723bs driver in the staging tree.
The changes address spacing issues, indentation, comment formatting,
blank lines, and minor code clarity improvements.

No functional changes are introduced. All commits adhere to the Linux kernel
coding style guidelines to enhance code readability and maintainability.

The patches have been tested and are ready for review.

Vivek BalachandharTN (20):
  staging: rtl8723bs: fix spacing around operators
  staging: rtl8723bs: remove unnecessary blank lines around braces
  staging: rtl8723bs: add blank line after function declaration
  staging: rtl8723bs: remove unnecessary space after type cast
  staging: rtl8723bs: remove space before tabs
  staging: rtl8723bs: fix overlong lines and clarify lengthy comments
  staging: rtl8723bs: align asterisk in block comment to fix formatting
  staging: rtl8723bs: fix logical continuation style by moving to
    previous line
  staging: rtl8723bs: fix indentation to align with open parenthesis
  staging: rtl8723bs: adding asterisks in multi-line block comments
  staging: rtl8723bs: remove space before semicolon
  staging: rtl8723bs: fix excessive indentation in nested if statement
  staging: rtl8723bs: fix unbalanced braces around conditional blocks
  staging: rtl8723bs: remove unnecessary parentheses around assignment
  staging: rtl8723bs: remove unnecessary braces for single statement
    blocks
  staging: rtl8723bs: add braces to all arms of conditional statement
  staging: rtl8723bs: add blank line after variable declarations
  staging: rtl8723bs: fix line ending with '('
  staging: rtl8723bs: place constant on right side of comparison
  staging: rtl8723bs: merge nested if conditions for clarity and tab
    problems

 drivers/staging/rtl8723bs/core/rtw_mlme.c | 506 ++++++++++++----------
 1 file changed, 285 insertions(+), 221 deletions(-)

-- 
2.39.5


^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH 01/20] staging: rtl8723bs: fix spacing around operators
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
@ 2025-07-26  4:31 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 02/20] staging: rtl8723bs: remove unnecessary blank lines around braces Vivek BalachandharTN
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:31 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

The driver contained multiple instances of inconsistent
or incorrect spacing around binary operators such as `+`,
`&&`, `>>`, `/`, `|`, `&`, `<<`, and others.
These violations reduce code readability and do not conform
to the Linux kernel coding style guidelines.

This commit standardizes spacing around all such operators,
improving code readability and maintainability. No functional
changes have been made.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 72 +++++++++++------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 692d0c2b766d..da64d5714237 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -256,8 +256,8 @@ void rtw_generate_random_ibss(u8 *pibss)
 	pibss[1] = 0x11;
 	pibss[2] = 0x87;
 	pibss[3] = (u8)(curtime & 0xff) ;/* p[0]; */
-	pibss[4] = (u8)((curtime>>8) & 0xff) ;/* p[1]; */
-	pibss[5] = (u8)((curtime>>16) & 0xff) ;/* p[2]; */
+	pibss[4] = (u8)((curtime >> 8) & 0xff) ;/* p[1]; */
+	pibss[5] = (u8)((curtime >> 16) & 0xff) ;/* p[2]; */
 }
 
 u8 *rtw_get_capability_from_ie(u8 *ie)
@@ -410,14 +410,14 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
 		sq_final = padapter->recvpriv.signal_qual;
 		/* the rssi value here is undecorated, and will be used for antenna diversity */
 		if (sq_smp != 101) /* from the right channel */
-			rssi_final = (src->rssi+dst->rssi*4)/5;
+			rssi_final = (src->rssi + dst->rssi * 4) / 5;
 		else
 			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;
-			rssi_final = (src->rssi+dst->rssi*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 */
 			ss_final = dst->phy_info.signal_strength;
@@ -587,7 +587,7 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
 	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;
@@ -832,14 +832,14 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 	struct dvobj_priv *psdpriv = adapter->dvobj;
 	struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
 
-	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE)) {
+	if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_AP_STATE)) {
 		struct sta_info *psta;
 
 		psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.mac_address);
 		rtw_free_stainfo(adapter,  psta);
 	}
 
-	if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE)) {
+	if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) {
 		struct sta_info *psta;
 
 		rtw_free_all_stainfo(adapter);
@@ -886,7 +886,7 @@ void rtw_indicate_disconnect(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING|WIFI_UNDER_WPS);
+	_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING | WIFI_UNDER_WPS);
 
 	if (rtw_to_roam(padapter) > 0)
 		_clr_fwstate_(pmlmepriv, _FW_LINKED);
@@ -913,7 +913,7 @@ inline void rtw_indicate_scan_done(struct adapter *padapter, bool aborted)
 
 	if ((!adapter_to_pwrctl(padapter)->bInSuspend) &&
 	    (!check_fwstate(&padapter->mlmepriv,
-			    WIFI_ASOC_STATE|WIFI_UNDER_LINKING))) {
+			    WIFI_ASOC_STATE | WIFI_UNDER_LINKING))) {
 		rtw_set_ips_deny(padapter, 0);
 		_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 1);
 	}
@@ -1053,8 +1053,8 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
 	switch (pnetwork->network.infrastructure_mode) {
 	case Ndis802_11Infrastructure:
 
-			if (pmlmepriv->fw_state&WIFI_UNDER_WPS)
-				pmlmepriv->fw_state = WIFI_STATION_STATE|WIFI_UNDER_WPS;
+			if (pmlmepriv->fw_state & WIFI_UNDER_WPS)
+				pmlmepriv->fw_state = WIFI_STATION_STATE | WIFI_UNDER_WPS;
 			else
 				pmlmepriv->fw_state = WIFI_STATION_STATE;
 
@@ -1224,7 +1224,7 @@ void rtw_sta_media_status_rpt(struct adapter *adapter, struct sta_info *psta, u3
 	if (!psta)
 		return;
 
-	media_status_rpt = (u16)((psta->mac_id<<8)|mstatus); /*   MACID|OPMODE:1 connect */
+	media_status_rpt = (u16)((psta->mac_id << 8) | mstatus); /*   MACID|OPMODE:1 connect */
 	rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status_rpt);
 }
 
@@ -1342,13 +1342,13 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 	if (mac_id >= 0) {
 		u16 media_status;
 
-		media_status = (mac_id<<8)|0; /*   MACID|OPMODE:0 means disconnect */
+		media_status = (mac_id << 8) | 0; /*   MACID|OPMODE:0 means disconnect */
 		/* for STA, AP, ADHOC mode, report disconnect stauts to FW */
 		rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status);
 	}
 
 	/* if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) */
-	if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
+	if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE)
 		return;
 
 	mlmeext_sta_del_event_callback(adapter);
@@ -1524,7 +1524,7 @@ void rtw_mlme_reset_auto_scan_int(struct adapter *adapter)
 	if (pmlmeinfo->VHT_enable) /* disable auto scan when connect to 11AC AP */
 		mlme->auto_scan_int_ms = 0;
 	else if (adapter->registrypriv.wifi_spec && is_client_associated_to_ap(adapter) == true)
-		mlme->auto_scan_int_ms = 60*1000;
+		mlme->auto_scan_int_ms = 60 * 1000;
 	else if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
 		if (check_fwstate(mlme, WIFI_STATION_STATE) && check_fwstate(mlme, _FW_LINKED))
 			mlme->auto_scan_int_ms = mlme->roam_scan_int_ms;
@@ -1923,7 +1923,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 	while (i < in_len) {
 		ielength = initial_out_len;
 
-		if (in_ie[i] == 0xDD && in_ie[i+2] == 0x00 && in_ie[i+3] == 0x50  && in_ie[i+4] == 0xF2 && in_ie[i+5] == 0x02 && i+5 < in_len) { /* WMM element ID and OUI */
+		if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && in_ie[i + 3] == 0x50  && in_ie[i + 4] == 0xF2 && in_ie[i + 5] == 0x02 && i + 5 < in_len) { /* WMM element ID and OUI */
 			for (j = i; j < i + 9; j++) {
 				out_ie[ielength] = in_ie[j];
 				ielength++;
@@ -1935,7 +1935,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 			break;
 		}
 
-		i += (in_ie[i+1]+2); /*  to the next IE element */
+		i += (in_ie[i + 1] + 2); /*  to the next IE element */
 	}
 
 	return ielength;
@@ -2009,13 +2009,13 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
 		authmode = WLAN_EID_RSN;
 
 	if (check_fwstate(pmlmepriv, WIFI_UNDER_WPS)) {
-		memcpy(out_ie+ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
+		memcpy(out_ie + ielength, psecuritypriv->wps_ie, psecuritypriv->wps_ie_len);
 
 		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);
-		ielength += 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);
 	}
 
@@ -2183,7 +2183,7 @@ void rtw_build_wmm_ie_ht(struct adapter *padapter, u8 *out_ie, uint *pout_len)
 
 	if (padapter->mlmepriv.qospriv.qos_option == 0) {
 		out_len = *pout_len;
-		rtw_set_ie(out_ie+out_len, WLAN_EID_VENDOR_SPECIFIC,
+		rtw_set_ie(out_ie + out_len, WLAN_EID_VENDOR_SPECIFIC,
 			   _WMM_IE_Length_, WMM_IE, pout_len);
 
 		padapter->mlmepriv.qospriv.qos_option = 1;
@@ -2227,7 +2227,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 	} else {
 		p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len);
 		if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) {
-			struct HT_info_element *pht_info = (struct HT_info_element *)(p+2);
+			struct HT_info_element *pht_info = (struct HT_info_element *)(p + 2);
 
 			if (pht_info->infos[0] & BIT(2)) {
 				switch (pht_info->infos[0] & 0x3) {
@@ -2290,14 +2290,14 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 		rtw_hal_get_def_var(padapter, HW_VAR_MAX_RX_AMPDU_FACTOR,
 				    &max_rx_ampdu_factor);
 
-	ht_capie.ampdu_params_info = (max_rx_ampdu_factor&0x03);
+	ht_capie.ampdu_params_info = (max_rx_ampdu_factor & 0x03);
 
 	if (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
-		ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&(0x07<<2));
+		ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
 	else
-		ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY&0x00);
+		ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
 
-	rtw_set_ie(out_ie+out_len, WLAN_EID_HT_CAPABILITY,
+	rtw_set_ie(out_ie + out_len, WLAN_EID_HT_CAPABILITY,
 		   sizeof(struct ieee80211_ht_cap), (unsigned char *)&ht_capie, pout_len);
 
 	phtpriv->ht_option = true;
@@ -2306,7 +2306,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 		p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len);
 		if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) {
 			out_len = *pout_len;
-			rtw_set_ie(out_ie+out_len, WLAN_EID_HT_OPERATION, ielen, p+2, pout_len);
+			rtw_set_ie(out_ie + out_len, WLAN_EID_HT_OPERATION, ielen, p + 2, pout_len);
 		}
 	}
 
@@ -2339,18 +2339,18 @@ 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);
+		pht_capie = (struct ieee80211_ht_cap *)(p + 2);
 		max_ampdu_sz = (pht_capie->ampdu_params_info & IEEE80211_HT_CAP_AMPDU_FACTOR);
-		max_ampdu_sz = 1 << (max_ampdu_sz+3); /*  max_ampdu_sz (kbytes); */
+		max_ampdu_sz = 1 << (max_ampdu_sz + 3); /*  max_ampdu_sz (kbytes); */
 
 		phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
 
 	}
 
 	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: */
 	}
@@ -2429,8 +2429,8 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
 	phtpriv = &psta->htpriv;
 
 	if (phtpriv->ht_option && phtpriv->ampdu_enable) {
-		issued = (phtpriv->agg_enable_bitmap>>priority)&0x1;
-		issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1;
+		issued = (phtpriv->agg_enable_bitmap >> priority) & 0x1;
+		issued |= (phtpriv->candidate_tid_bitmap >> priority) & 0x1;
 
 		if (issued == 0) {
 			psta->htpriv.candidate_tid_bitmap |= BIT((u8)priority);
@@ -2501,7 +2501,7 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 signed int rtw_linked_check(struct adapter *padapter)
 {
 	if ((check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) ||
-			(check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE) == true)) {
+			(check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE) == true)) {
 		if (padapter->stapriv.asoc_sta_count > 2)
 			return true;
 	} else {	/* Station mode */
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 02/20] staging: rtl8723bs: remove unnecessary blank lines around braces
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
  2025-07-26  4:31 ` [PATCH 01/20] staging: rtl8723bs: fix spacing around operators Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 03/20] staging: rtl8723bs: add blank line after function declaration Vivek BalachandharTN
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

The driver contained several unnecessary blank lines immediately
before or after opening and closing braces in function
definitions and control blocks.

These blank lines break the visual flow of the code and violate
the Linux kernel coding style, which discourages superfluous
vertical spacing.

This commit removes the extra blank lines to improve code
consistency and readability. No functional changes are introduced.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 29 -----------------------
 1 file changed, 29 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index da64d5714237..24e505111f1f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -170,7 +170,6 @@ void _rtw_free_network(struct	mlme_priv *pmlmepriv, struct wlan_network *pnetwor
 
 void _rtw_free_network_nolock(struct	mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
 {
-
 	struct __queue *free_queue = &pmlmepriv->free_bss_pool;
 
 	if (!pnetwork)
@@ -225,11 +224,9 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
 
 	phead = get_list_head(scanned_queue);
 	list_for_each_safe(plist, tmp, phead) {
-
 		pnetwork = list_entry(plist, struct wlan_network, list);
 
 		_rtw_free_network(pmlmepriv, pnetwork, isfreeall);
-
 	}
 
 	spin_unlock_bh(&scanned_queue->lock);
@@ -318,7 +315,6 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
 		ret = true;
 
 	return ret;
-
 }
 
 inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
@@ -348,7 +344,6 @@ int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 fea
 			(d_cap & WLAN_CAPABILITY_IBSS)) &&
 			((s_cap & WLAN_CAPABILITY_ESS) ==
 			(d_cap & WLAN_CAPABILITY_ESS));
-
 }
 
 struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struct wlan_network *network)
@@ -380,7 +375,6 @@ struct	wlan_network	*rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
 	phead = get_list_head(scanned_queue);
 
 	list_for_each(plist, phead) {
-
 		pwlan = list_entry(plist, struct wlan_network, list);
 
 		if (!pwlan->fixed) {
@@ -389,7 +383,6 @@ struct	wlan_network	*rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
 		}
 	}
 	return oldest;
-
 }
 
 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
@@ -424,7 +417,6 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
 			sq_final = dst->phy_info.signal_quality;
 			rssi_final = dst->rssi;
 		}
-
 	}
 
 	if (update_ie) {
@@ -486,7 +478,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 
 		if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
 			oldest = pnetwork;
-
 	}
 
 	/* If we didn't find a match, then get a new network slot to initialize
@@ -530,7 +521,6 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 				pnetwork->network.phy_info.signal_quality = 0;
 
 			list_add_tail(&pnetwork->list, &queue->queue);
-
 		}
 	} else {
 		/* we have an entry and we are going to update it. But this entry may
@@ -591,7 +581,6 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
 			return true;
 		else
 			return false;
-
 	}
 	if (adapter->registrypriv.wifi_spec == 1) { /* for  correct flow of 8021X  to do.... */
 		u8 *p = NULL;
@@ -868,7 +857,6 @@ void rtw_indicate_connect(struct adapter *padapter)
 	pmlmepriv->to_join = false;
 
 	if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
-
 		set_fwstate(pmlmepriv, _FW_LINKED);
 
 		rtw_os_indicate_connect(padapter);
@@ -876,7 +864,6 @@ void rtw_indicate_connect(struct adapter *padapter)
 
 	rtw_set_to_roam(padapter, 0);
 	rtw_set_scan_deny(padapter, 3000);
-
 }
 
 /*
@@ -929,7 +916,6 @@ void rtw_scan_abort(struct adapter *adapter)
 	pmlmeext->scan_abort = true;
 	while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
 		&& jiffies_to_msecs(start) <= 200) {
-
 		if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
 			break;
 
@@ -1022,7 +1008,6 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
 	}
 
 	return psta;
-
 }
 
 /* pnetwork : returns from rtw_joinbss_event_callback */
@@ -1397,7 +1382,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 
 	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
 	      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) */
@@ -1431,7 +1415,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 			if (ret != _SUCCESS)
 				goto unlock;
 		}
-
 	}
 
 unlock:
@@ -1490,7 +1473,6 @@ void _rtw_join_timeout_handler(struct timer_list *t)
 
 		/* indicate disconnect for the case that join_timeout and check_fwstate != FW_LINKED */
 		rtw_cfg80211_indicate_disconnect(adapter);
-
 	}
 
 	spin_unlock_bh(&pmlmepriv->lock);
@@ -1540,7 +1522,6 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
 
 	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) == true)
 				goto exit;
@@ -1673,12 +1654,10 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
 	phead = get_list_head(queue);
 
 	list_for_each(mlme->pscanned, phead) {
-
 		pnetwork = list_entry(mlme->pscanned, struct wlan_network,
 				      list);
 
 		rtw_check_roaming_candidate(mlme, &candidate, pnetwork);
-
 	}
 
 	if (!candidate) {
@@ -1770,14 +1749,11 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 
 	phead = get_list_head(queue);
 	list_for_each(pmlmepriv->pscanned, phead) {
-
 		pnetwork = list_entry(pmlmepriv->pscanned,
 				      struct wlan_network, list);
 
 		rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
-
 	}
-
 	if (!candidate) {
 		ret = _FAIL;
 		goto exit;
@@ -1863,7 +1839,6 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
 		adapter->securitypriv.key_mask |= BIT(psetkeyparm->keyid);
 
 	switch (psetkeyparm->algorithm) {
-
 	case _WEP40_:
 		keylen = 5;
 		memcpy(&psetkeyparm->key[0], &psecuritypriv->dot11DefKey[keyid].skey[0], keylen);
@@ -1939,7 +1914,6 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 	}
 
 	return ielength;
-
 }
 
 /*  */
@@ -2311,7 +2285,6 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 	}
 
 	return phtpriv->ht_option;
-
 }
 
 /* the function is > passive_level (in critical_section) */
@@ -2346,7 +2319,6 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
 		max_ampdu_sz = 1 << (max_ampdu_sz + 3); /*  max_ampdu_sz (kbytes); */
 
 		phtpriv->rx_ampdu_maxlen = max_ampdu_sz;
-
 	}
 
 	len = 0;
@@ -2437,7 +2409,6 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
 			rtw_addbareq_cmd(padapter, (u8) priority, pattrib->ra);
 		}
 	}
-
 }
 
 void rtw_append_exented_cap(struct adapter *padapter, u8 *out_ie, uint *pout_len)
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 03/20] staging: rtl8723bs: add blank line after function declaration
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
  2025-07-26  4:31 ` [PATCH 01/20] staging: rtl8723bs: fix spacing around operators Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 02/20] staging: rtl8723bs: remove unnecessary blank lines around braces Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-28  4:36   ` [PATCH v1 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming() Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 04/20] staging: rtl8723bs: remove unnecessary space after type cast Vivek BalachandharTN
                   ` (17 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Added a blank line after the definition of rtw_roaming()
to improve code readability and conform with Linux kernel
coding style.

No functional changes made.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 24e505111f1f..b1a427a655ef 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 04/20] staging: rtl8723bs: remove unnecessary space after type cast
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (2 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 03/20] staging: rtl8723bs: add blank line after function declaration Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 05/20] staging: rtl8723bs: remove space before tabs Vivek BalachandharTN
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed unnecessary space between the cast and the variable
in two instances of type casting. This change improves code
consistency and aligns with Linux kernel coding style
guidelines.

No functional changes made.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b1a427a655ef..536b6d036e88 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1055,7 +1055,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);
 }
 
 /* Notes: the function could be > passive_level (the same context as Rx tasklet) */
@@ -2406,7 +2406,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);
 		}
 	}
 }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 05/20] staging: rtl8723bs: remove space before tabs
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (3 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 04/20] staging: rtl8723bs: remove unnecessary space after type cast Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 06/20] staging: rtl8723bs: fix overlong lines and clarify lengthy comments Vivek BalachandharTN
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed occurrences of space characters preceding tab characters
in the codebase. Spaces before tabs cause inconsistent indentation
and are flagged by checkpatch.pl as style violations.

This change improves code formatting consistency and adheres
to the Linux kernel coding style.

No functional changes made.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 26 +++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 536b6d036e88..f8680124ce24 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -559,10 +559,10 @@ void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
 
 /* select the desired network based on the capability of the (i)bss. */
 /*  check items: (1) security */
-/* 			   (2) network_type */
-/* 			   (3) WMM */
-/* 			   (4) HT */
-/*                      (5) others */
+/*		 (2) network_type */
+/*		 (3) WMM */
+/*		 (4) HT */
+/*               (5) others */
 int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork);
 int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwork)
 {
@@ -1819,7 +1819,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
 	u8 keylen;
 	struct cmd_obj		*pcmd;
 	struct setkey_parm	*psetkeyparm;
-	struct cmd_priv 	*pcmdpriv = &adapter->cmdpriv;
+	struct cmd_priv		*pcmdpriv = &adapter->cmdpriv;
 	signed int	res = _SUCCESS;
 
 	psetkeyparm = rtw_zmalloc(sizeof(struct setkey_parm));
@@ -1922,8 +1922,8 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 /*  */
 /*  Search by BSSID, */
 /*  Return Value: */
-/* 		-1		:if there is no pre-auth key in the  table */
-/* 		>= 0		:if there is pre-auth key, and   return the entry id */
+/*		-1		:if there is no pre-auth key in the  table */
+/*		>= 0		:if there is pre-auth key, and   return the entry id */
 /*  */
 /*  */
 
@@ -2073,7 +2073,7 @@ void rtw_joinbss_reset(struct adapter *padapter)
 	u8 threshold;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
-	struct ht_priv 	*phtpriv = &pmlmepriv->htpriv;
+	struct ht_priv	*phtpriv = &pmlmepriv->htpriv;
 
 	/* todo: if you want to do something io/reg/hw setting before join_bss, please add code here */
 
@@ -2099,8 +2099,8 @@ void rtw_joinbss_reset(struct adapter *padapter)
 
 void rtw_ht_use_default_setting(struct adapter *padapter)
 {
-	struct mlme_priv 	*pmlmepriv = &padapter->mlmepriv;
-	struct ht_priv 	*phtpriv = &pmlmepriv->htpriv;
+	struct mlme_priv	*pmlmepriv = &padapter->mlmepriv;
+	struct ht_priv	*phtpriv = &pmlmepriv->htpriv;
 	struct registry_priv *pregistrypriv = &padapter->registrypriv;
 	bool		bHwLDPCSupport = false, bHwSTBCSupport = false;
 	bool		bHwSupportBeamformer = false, bHwSupportBeamformee = false;
@@ -2174,7 +2174,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 	u8 cbw40_enable = 0, stbc_rx_enable = 0, operation_bw = 0;
 	struct registry_priv *pregistrypriv = &padapter->registrypriv;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct ht_priv 	*phtpriv = &pmlmepriv->htpriv;
+	struct ht_priv	*phtpriv = &pmlmepriv->htpriv;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 
 	phtpriv->ht_option = false;
@@ -2294,7 +2294,7 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len, u8 channe
 	int len;
 	struct ieee80211_ht_cap *pht_capie;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct ht_priv 	*phtpriv = &pmlmepriv->htpriv;
+	struct ht_priv	*phtpriv = &pmlmepriv->htpriv;
 	struct registry_priv *pregistrypriv = &padapter->registrypriv;
 	struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
 	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
@@ -2414,7 +2414,7 @@ void rtw_issue_addbareq_cmd(struct adapter *padapter, struct xmit_frame *pxmitfr
 void rtw_append_exented_cap(struct adapter *padapter, u8 *out_ie, uint *pout_len)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-	struct ht_priv 	*phtpriv = &pmlmepriv->htpriv;
+	struct ht_priv	*phtpriv = &pmlmepriv->htpriv;
 	u8 cap_content[8] = {0};
 
 	if (phtpriv->bss_coexist)
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 06/20] staging: rtl8723bs: fix overlong lines and clarify lengthy comments
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (4 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 05/20] staging: rtl8723bs: remove space before tabs Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 07/20] staging: rtl8723bs: align asterisk in block comment to fix formatting Vivek BalachandharTN
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

This commit addresses two main issues:

1. Fixed multiple instances of overlong lines in the code to conform with
   Linux kernel style guidelines, which recommend lines not exceed 80
   characters for better readability in various editors and tools.

2. Clarified a lengthy comment block by reformatting it into a more readable,
   multi-line style with proper indentation and phrasing. The updated comment
   now clearly explains the function's context, parameters, and behavior in
   a concise and structured manner, improving maintainability.

No functional changes were made; this is purely a code style and documentation
improvement.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 242 +++++++++++++++-------
 1 file changed, 166 insertions(+), 76 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index f8680124ce24..fb1768284c2e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -22,7 +22,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 varable to "active_mode" (Jeff)
+	 */
+	pmlmepriv->scan_mode = SCAN_ACTIVE;
 
 	spin_lock_init(&pmlmepriv->lock);
 	INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
@@ -95,7 +98,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);
 }
 
@@ -346,7 +350,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;
@@ -396,8 +401,11 @@ void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
 	u8 sq_final;
 	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)) {
+	/* 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)) {
 		/* Take the recvpriv's value for the connected AP*/
 		ss_final = padapter->recvpriv.signal_strength;
 		sq_final = padapter->recvpriv.signal_qual;
@@ -408,11 +416,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;
@@ -439,10 +451,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) == true) && (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
+	if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
+	    (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);
 	}
 }
 
@@ -577,7 +592,9 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
 	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;
@@ -590,7 +607,8 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
 			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
@@ -602,7 +620,8 @@ int rtw_is_desired_network(struct adapter *adapter, struct wlan_network *pnetwor
 		bselected = false;
 
 	if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
-		if (pnetwork->network.infrastructure_mode != pmlmepriv->cur_network.network.infrastructure_mode)
+		if (pnetwork->network.infrastructure_mode !=
+			pmlmepriv->cur_network.network.infrastructure_mode)
 			bselected = false;
 	}
 
@@ -630,12 +649,14 @@ void rtw_survey_event_callback(struct adapter	*adapter, u8 *pbuf)
 
 	/*  update IBSS_network 's timestamp */
 	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) == true) {
-		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);
@@ -686,13 +707,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);
@@ -719,8 +745,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);
@@ -739,8 +768,9 @@ 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);
 				}
 			}
 		}
@@ -928,7 +958,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;
@@ -984,9 +1015,12 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
 			padapter->securitypriv.wps_ie_len = 0;
 		}
 
-		/* 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 */
-		/* todo: check if AP can send A-MPDU packets */
+		/*
+		 * 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.
+		 * todo: check if AP can send A-MPDU packets.
+		 */
 		for (i = 0; i < 16 ; i++) {
 			preorder_ctrl = &psta->recvreorder_ctrl[i];
 			preorder_ctrl->enable = false;
@@ -1002,7 +1036,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;
 			}
 		}
 	}
@@ -1012,7 +1047,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;
@@ -1029,8 +1066,12 @@ 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);
 
@@ -1052,20 +1093,30 @@ 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);
 }
 
-/* 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_ADHOC_STATE), we only check if "ptarget_wlan" exist. */
-/* if join_res > 0, update "cur_network->network" from "pnetwork->network" if (ptarget_wlan != NULL). */
-/*  */
-/* define REJOIN */
+/*
+ * The function can be called at > PASSIVE_LEVEL (same context as Rx tasklet).
+ * 'pnetwork' is returned from rtw_joinbss_event_callback.
+ * 'ptarget_wlan' is found from scanned_queue.
+ *
+ * If join_res > 0 and fw_state == WIFI_STATION_STATE, we check whether
+ * 'ptarget_sta' and 'ptarget_wlan' exist.
+ *
+ * If join_res > 0 and fw_state == WIFI_ADHOC_STATE, we only check whether
+ * 'ptarget_wlan' exists.
+ *
+ * If join_res > 0 and 'ptarget_wlan' is not NULL, update
+ * cur_network->network from pnetwork->network.
+ *
+ * Define REJOIN.
+ */
 void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 {
 	static u8 __maybe_unused retry;
@@ -1077,7 +1128,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))
@@ -1130,7 +1182,9 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 				goto ignore_joinbss_callback;
 			}
 
-			/* 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) == true) {
 				ptarget_sta = rtw_joinbss_update_stainfo(adapter, pnetwork);
 				if (!ptarget_sta) {
@@ -1262,8 +1316,10 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
 	psta = rtw_get_stainfo(&adapter->stapriv, pstassoc->macaddr);
 	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);
@@ -1290,7 +1346,8 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
 		(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
 		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;
@@ -1347,16 +1404,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 {
@@ -1370,7 +1430,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);
@@ -1384,11 +1445,13 @@ 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) */
+		if (adapter->stapriv.asoc_sta_count == 1) {
+			/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
 			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);
@@ -1398,9 +1461,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);
 
@@ -1471,7 +1536,9 @@ void _rtw_join_timeout_handler(struct timer_list *t)
 		rtw_indicate_disconnect(adapter);
 		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);
 	}
 
@@ -1520,8 +1587,8 @@ 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) == true)
 				goto exit;
@@ -1563,7 +1630,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 {
@@ -1623,7 +1692,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)
@@ -1697,7 +1767,8 @@ 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)
+			|| memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid,
+				  mlme->assoc_ssid.ssid_length)
 		)
 			goto exit;
 	}
@@ -1814,7 +1885,8 @@ 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;
@@ -1889,7 +1961,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;
@@ -1898,7 +1971,9 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
 	while (i < in_len) {
 		ielength = initial_out_len;
 
-		if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && in_ie[i + 3] == 0x50  && in_ie[i + 4] == 0xF2 && in_ie[i + 5] == 0x02 && i + 5 < in_len) { /* WMM element ID and OUI */
+		if (in_ie[i] == 0xDD && in_ie[i + 2] == 0x00 && in_ie[i + 3] == 0x50  &&
+		    in_ie[i + 4] == 0xF2 && in_ie[i + 5] == 0x02 && i + 5 < in_len) {
+			/* WMM element ID and OUI */
 			for (j = i; j < i + 9; j++) {
 				out_ie[ielength] = in_ie[j];
 				ielength++;
@@ -1988,7 +2063,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);
 	}
@@ -2026,7 +2102,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;
 
@@ -2056,14 +2133,18 @@ 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); */
 }
 
@@ -2075,7 +2156,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;
 
@@ -2165,7 +2248,8 @@ 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;
@@ -2246,7 +2330,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);
 
@@ -2312,7 +2397,8 @@ 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);
@@ -2322,7 +2408,8 @@ 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: */
 	}
@@ -2338,7 +2425,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);
@@ -2456,7 +2544,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;
 
@@ -2473,7 +2562,8 @@ void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 signed int rtw_linked_check(struct adapter *padapter)
 {
 	if ((check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true) ||
-			(check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE) == true)) {
+	    (check_fwstate(&padapter->mlmepriv, WIFI_ADHOC_STATE |
+			   WIFI_ADHOC_MASTER_STATE) == true)) {
 		if (padapter->stapriv.asoc_sta_count > 2)
 			return true;
 	} else {	/* Station mode */
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 07/20] staging: rtl8723bs: align asterisk in block comment to fix formatting
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (5 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 06/20] staging: rtl8723bs: fix overlong lines and clarify lengthy comments Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 08/20] staging: rtl8723bs: fix logical continuation style by moving to previous line Vivek BalachandharTN
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Aligned the leading asterisks in a multi-line block comment to maintain
consistent formatting and improve readability. This aligns with kernel
coding style guidelines for comment formatting.

No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 40 +++++++++++------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index fb1768284c2e..0c985593ff0c 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -842,8 +842,8 @@ static void find_network(struct adapter *adapter)
 }
 
 /*
-*rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock
-*/
+ *rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock
+ */
 void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 {
 	struct	mlme_priv *pmlmepriv = &adapter->mlmepriv;
@@ -878,8 +878,8 @@ void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
 }
 
 /*
-*rtw_indicate_connect: the caller has to lock pmlmepriv->lock
-*/
+ *rtw_indicate_connect: the caller has to lock pmlmepriv->lock
+ */
 void rtw_indicate_connect(struct adapter *padapter)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -897,8 +897,8 @@ void rtw_indicate_connect(struct adapter *padapter)
 }
 
 /*
-*rtw_indicate_disconnect: the caller has to lock pmlmepriv->lock
-*/
+ *rtw_indicate_disconnect: the caller has to lock pmlmepriv->lock
+ */
 void rtw_indicate_disconnect(struct adapter *padapter)
 {
 	struct	mlme_priv *pmlmepriv = &padapter->mlmepriv;
@@ -1501,9 +1501,9 @@ void rtw_wmm_event_callback(struct adapter *padapter, u8 *pbuf)
 }
 
 /*
-* _rtw_join_timeout_handler - Timeout/failure handler for CMD JoinBss
-* @adapter: pointer to struct adapter structure
-*/
+ * _rtw_join_timeout_handler - Timeout/failure handler for CMD JoinBss
+ * @adapter: pointer to struct adapter structure
+ */
 void _rtw_join_timeout_handler(struct timer_list *t)
 {
 	struct adapter *adapter = timer_container_of(adapter, t,
@@ -1546,9 +1546,9 @@ void _rtw_join_timeout_handler(struct timer_list *t)
 }
 
 /*
-* rtw_scan_timeout_handler - Timeout/Failure handler for CMD SiteSurvey
-* @adapter: pointer to struct adapter structure
-*/
+ * rtw_scan_timeout_handler - Timeout/Failure handler for CMD SiteSurvey
+ * @adapter: pointer to struct adapter structure
+ */
 void rtw_scan_timeout_handler(struct timer_list *t)
 {
 	struct adapter *adapter = timer_container_of(adapter, t,
@@ -1666,10 +1666,10 @@ void rtw_set_scan_deny(struct adapter *adapter, u32 ms)
 }
 
 /*
-* Select a new roaming candidate from the original @param candidate and @param competitor
-* @return true: candidate is updated
-* @return false: candidate is not updated
-*/
+ * Select a new roaming candidate from the original @param candidate and @param competitor
+ * @return true: candidate is updated
+ * @return false: candidate is not updated
+ */
 static int rtw_check_roaming_candidate(struct mlme_priv *mlme
 	, struct wlan_network **candidate, struct wlan_network *competitor)
 {
@@ -1748,10 +1748,10 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme)
 }
 
 /*
-* Select a new join candidate from the original @param candidate and @param competitor
-* @return true: candidate is updated
-* @return false: candidate is not updated
-*/
+ * Select a new join candidate from the original @param candidate and @param competitor
+ * @return true: candidate is updated
+ * @return false: candidate is not updated
+ */
 static int rtw_check_join_candidate(struct mlme_priv *mlme
 	, struct wlan_network **candidate, struct wlan_network *competitor)
 {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 08/20] staging: rtl8723bs: fix logical continuation style by moving to previous line
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (6 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 07/20] staging: rtl8723bs: align asterisk in block comment to fix formatting Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 09/20] staging: rtl8723bs: fix indentation to align with open parenthesis Vivek BalachandharTN
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Reformatted a logical continuation to sit on the same line as the previous
statement, as per kernel coding style guidelines. This improves code
readability and avoids unnecessary line breaks.

No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 29 ++++++++++++-----------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 0c985593ff0c..692d2526965f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -323,8 +323,8 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
 
 inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
 {
-	return (a->ssid.ssid_length == b->ssid.ssid_length)
-		&&  !memcmp(a->ssid.ssid, b->ssid.ssid, a->ssid.ssid_length);
+	return (a->ssid.ssid_length == b->ssid.ssid_length) &&
+		!memcmp(a->ssid.ssid, b->ssid.ssid, a->ssid.ssid_length);
 }
 
 int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feature)
@@ -765,8 +765,8 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 		}
 	} else {
 		if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
-			if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
-				&& check_fwstate(pmlmepriv, _FW_LINKED)) {
+			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,
@@ -908,8 +908,8 @@ void rtw_indicate_disconnect(struct adapter *padapter)
 	if (rtw_to_roam(padapter) > 0)
 		_clr_fwstate_(pmlmepriv, _FW_LINKED);
 
-	if (check_fwstate(&padapter->mlmepriv, _FW_LINKED)
-		|| (rtw_to_roam(padapter) <= 0)
+	if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) ||
+	    (rtw_to_roam(padapter) <= 0)
 	) {
 		rtw_os_indicate_disconnect(padapter);
 
@@ -944,8 +944,8 @@ void rtw_scan_abort(struct adapter *adapter)
 
 	start = jiffies;
 	pmlmeext->scan_abort = true;
-	while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
-		&& jiffies_to_msecs(start) <= 200) {
+	while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) &&
+	       jiffies_to_msecs(start) <= 200) {
 		if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
 			break;
 
@@ -1618,8 +1618,8 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter)
 	if (adapter->net_closed)
 		return;
 
-	if ((adapter_to_pwrctl(adapter)->fw_current_in_ps_mode)
-		&& !(hal_btcoex_IsBtControlLps(adapter))
+	if ((adapter_to_pwrctl(adapter)->fw_current_in_ps_mode) &&
+	    !(hal_btcoex_IsBtControlLps(adapter))
 		) {
 		u8 bEnterPS;
 
@@ -1766,8 +1766,8 @@ 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,
+		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;
@@ -1777,8 +1777,9 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
 		goto exit;
 
 	if (rtw_to_roam(adapter) > 0) {
-		if (jiffies_to_msecs(jiffies - competitor->last_scanned) >= mlme->roam_scanr_exp_ms
-			|| is_same_ess(&competitor->network, &mlme->cur_network.network) == false
+		if (jiffies_to_msecs(jiffies - competitor->last_scanned) >=
+		    mlme->roam_scanr_exp_ms ||
+		    is_same_ess(&competitor->network, &mlme->cur_network.network) == false
 		)
 			goto exit;
 	}
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 09/20] staging: rtl8723bs: fix indentation to align with open parenthesis
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (7 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 08/20] staging: rtl8723bs: fix logical continuation style by moving to previous line Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 10/20] staging: rtl8723bs: adding asterisks in multi-line block comments Vivek BalachandharTN
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Adjusted indentation of function arguments to align with the
opening parenthesis, following kernel coding style guidelines.
This enhances readability and maintains consistent formatting.

No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 692d2526965f..e709a0bd24f3 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -154,7 +154,7 @@ void _rtw_free_network(struct	mlme_priv *pmlmepriv, struct wlan_network *pnetwor
 		return;
 
 	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
-		(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
+	    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
 		lifetime = 1;
 
 	if (!isfreeall) {
@@ -241,7 +241,7 @@ signed int rtw_if_up(struct adapter *padapter)
 	signed int res;
 
 	if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
-		(check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false))
+	    (check_fwstate(&padapter->mlmepriv, _FW_LINKED) == false))
 		res = false;
 	else
 		res =  true;
@@ -310,7 +310,7 @@ int rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
 	struct security_priv *psecuritypriv = &adapter->securitypriv;
 
 	if ((psecuritypriv->dot11PrivacyAlgrthm != _NO_PRIVACY_) &&
-		    (pnetwork->network.privacy == 0))
+	    (pnetwork->network.privacy == 0))
 		ret = false;
 	else if ((psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_) &&
 		 (pnetwork->network.privacy == 1))
@@ -391,7 +391,7 @@ struct	wlan_network	*rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
 }
 
 void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
-	struct adapter *padapter, bool update_ie)
+		    struct adapter *padapter, bool update_ie)
 {
 	long rssi_ori = dst->rssi;
 
@@ -447,9 +447,9 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
 	struct	mlme_priv *pmlmepriv = &adapter->mlmepriv;
 
 	rtw_bug_check(&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network,
-		&pmlmepriv->cur_network.network);
+		      &pmlmepriv->cur_network.network,
+		      &pmlmepriv->cur_network.network,
+		      &pmlmepriv->cur_network.network);
 
 	if ((check_fwstate(pmlmepriv, _FW_LINKED) == true) &&
 	    (is_same_network(&pmlmepriv->cur_network.network, pnetwork, 0))) {
@@ -1343,7 +1343,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
 	spin_lock_bh(&pmlmepriv->lock);
 
 	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
-		(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+	    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
 		if (adapter->stapriv.asoc_sta_count == 2) {
 			spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 			ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue,
@@ -1442,7 +1442,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 	}
 
 	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
-	      check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+	    check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
 		rtw_free_stainfo(adapter,  psta);
 
 		if (adapter->stapriv.asoc_sta_count == 1) {
@@ -1768,7 +1768,7 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
 	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)
+			   mlme->assoc_ssid.ssid_length)
 		)
 			goto exit;
 	}
@@ -2010,7 +2010,7 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
 
 	for (i = 0; i < NUM_PMKID_CACHE; i++)
 		if ((p->PMKIDList[i].bUsed) &&
-				(!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
+		    (!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
 			return i;
 	return -1;
 }
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 10/20] staging: rtl8723bs: adding asterisks in multi-line block comments
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (8 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 09/20] staging: rtl8723bs: fix indentation to align with open parenthesis Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 11/20] staging: rtl8723bs: remove space before semicolon Vivek BalachandharTN
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Formatted multi-line block comments by adding leading asterisks (*)
on each line, in accordance with kernel coding style guidelines.
This improves consistency and readability of the comments.

No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 33 ++++++++++++-----------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index e709a0bd24f3..161f149bf244 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -188,10 +188,10 @@ void _rtw_free_network_nolock(struct	mlme_priv *pmlmepriv, struct wlan_network *
 }
 
 /*
-	return the wlan_network with the matching addr
-
-	Shall be called under atomic context... to avoid possible racing condition...
-*/
+ *	return the wlan_network with the matching addr
+ *
+ *	Shall be called under atomic context... to avoid possible racing condition...
+ */
 struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr)
 {
 	struct list_head	*phead, *plist;
@@ -293,10 +293,10 @@ void rtw_free_network_nolock(struct adapter *padapter, struct wlan_network *pnet
 }
 
 /*
-	return the wlan_network with the matching addr
-
-	Shall be called under atomic context... to avoid possible racing condition...
-*/
+ *	return the wlan_network with the matching addr
+ *
+ *	Shall be called under atomic context... to avoid possible racing condition...
+ */
 struct	wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
 {
 	struct	wlan_network *pnetwork = _rtw_find_network(scanned_queue, addr);
@@ -462,8 +462,8 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
 }
 
 /*
-Caller must hold pmlmepriv->lock first.
-*/
+ * Caller must hold pmlmepriv->lock first.
+ */
 void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
 {
 	struct list_head	*plist, *phead;
@@ -496,7 +496,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 	}
 
 	/* If we didn't find a match, then get a new network slot to initialize
-	 * with this beacon's information */
+	 * with this beacon's information
+	 */
 	if (!target_find) {
 		if (list_empty(&pmlmepriv->free_bss_pool.queue)) {
 			/* If there are no more slots, expire the oldest */
@@ -1794,11 +1795,11 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
 }
 
 /*
-Calling context:
-The caller of the sub-routine will be in critical section...
-The caller must hold the following spinlock
-pmlmepriv->lock
-*/
+ * Calling context:
+ * The caller of the sub-routine will be in critical section...
+ * The caller must hold the following spinlock
+ * pmlmepriv->lock
+ */
 
 int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
 {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 11/20] staging: rtl8723bs: remove space before semicolon
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (9 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 10/20] staging: rtl8723bs: adding asterisks in multi-line block comments Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 12/20] staging: rtl8723bs: fix excessive indentation in nested if statement Vivek BalachandharTN
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed an unnecessary space before a semicolon to comply with kernel
coding style. This change affects a single line.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 161f149bf244..547734f5492e 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2105,7 +2105,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
 	struct	wlan_network	*cur_network = &adapter->mlmepriv.cur_network;
 
 	/*  adhoc no 802.1x */
-	pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ;
+	pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0);
 
 	pdev_network->rssi = 0;
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 12/20] staging: rtl8723bs: fix excessive indentation in nested if statement
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (10 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 11/20] staging: rtl8723bs: remove space before semicolon Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 13/20] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Reduced indentation in a nested if-statement to match kernel coding
style and improve readability. No functional changes introduced.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 547734f5492e..0679253355fb 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1160,8 +1160,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 
 					ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.mac_address);
 					if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
-						if (ptarget_wlan)
-							ptarget_wlan->fixed = true;
+					    if (ptarget_wlan)
+						ptarget_wlan->fixed = true;
 					}
 				}
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 13/20] staging: rtl8723bs: fix unbalanced braces around conditional blocks
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (11 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 12/20] staging: rtl8723bs: fix excessive indentation in nested if statement Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment Vivek BalachandharTN
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Fixed improperly balanced braces around conditional blocks to match
kernel coding style and prevent potential confusion. This improves
code structure and readability without changing logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 0679253355fb..3702d7e7a954 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -758,8 +758,9 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 					} else {
 						pmlmepriv->to_join = true;
 					}
-				} else
+				} else {
 					rtw_indicate_disconnect(adapter);
+				}
 
 				_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
 			}
@@ -1578,8 +1579,9 @@ void rtw_mlme_reset_auto_scan_int(struct adapter *adapter)
 	else if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
 		if (check_fwstate(mlme, WIFI_STATION_STATE) && check_fwstate(mlme, _FW_LINKED))
 			mlme->auto_scan_int_ms = mlme->roam_scan_int_ms;
-	} else
+	} else {
 		mlme->auto_scan_int_ms = 0; /* disabled */
+	}
 }
 
 static void rtw_auto_scan_handler(struct adapter *padapter)
@@ -2281,9 +2283,10 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie,
 			operation_bw = padapter->mlmeextpriv.cur_bwmode;
 			if (operation_bw > CHANNEL_WIDTH_40)
 				operation_bw = CHANNEL_WIDTH_40;
-		} else
+		} else {
 			/* TDLS: TODO 40? */
 			operation_bw = CHANNEL_WIDTH_40;
+		}
 	} else {
 		p = rtw_get_ie(in_ie, WLAN_EID_HT_OPERATION, &ielen, in_len);
 		if (p && (ielen == sizeof(struct ieee80211_ht_addt_info))) {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (12 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 13/20] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-28  6:35   ` [PATCH v1 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 15/20] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
                   ` (6 subsequent siblings)
  20 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed superfluous parentheses surrounding an assignment to match kernel
coding style. This simplifies the expression and improves readability
without altering logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 3702d7e7a954..d845eaecd615 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -700,7 +700,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 15/20] staging: rtl8723bs: remove unnecessary braces for single statement blocks
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (13 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 16/20] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed braces from conditional blocks that contain only a single statement,
as per Linux kernel coding style guidelines. This enhances code clarity
and reduces visual clutter.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index d845eaecd615..fb7ab7eceb54 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -487,9 +487,8 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
 			break;
 		}
 
-		if (rtw_roam_flags(adapter)) {
+		if (rtw_roam_flags(adapter))
 			/* TODO: don't select network in the same ess as oldest if it's new enough*/
-		}
 
 		if (!oldest || time_after(oldest->last_scanned, pnetwork->last_scanned))
 			oldest = pnetwork;
@@ -2415,9 +2414,8 @@ 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));
-	if (p && len > 0) {
+	if (p && len > 0)
 		/* todo: */
-	}
 
 	if ((pregistrypriv->bw_mode & 0x0f) > 0)
 		cbw40_enable = 1;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 16/20] staging: rtl8723bs: add braces to all arms of conditional statement
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (14 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 15/20] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 17/20] staging: rtl8723bs: add blank line after variable declarations Vivek BalachandharTN
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Added braces to all branches of conditional statements for consistency
and to prevent potential future errors when modifying or extending logic.

This aligns with kernel coding style recommendations for clarity
and maintainability.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index fb7ab7eceb54..7552f7e4d14a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1571,11 +1571,11 @@ void rtw_mlme_reset_auto_scan_int(struct adapter *adapter)
 	struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
 	struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
 
-	if (pmlmeinfo->VHT_enable) /* disable auto scan when connect to 11AC AP */
+	if (pmlmeinfo->VHT_enable) { /* disable auto scan when connect to 11AC AP */
 		mlme->auto_scan_int_ms = 0;
-	else if (adapter->registrypriv.wifi_spec && is_client_associated_to_ap(adapter) == true)
+	} else if (adapter->registrypriv.wifi_spec && is_client_associated_to_ap(adapter) == true) {
 		mlme->auto_scan_int_ms = 60 * 1000;
-	else if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
+	} else if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
 		if (check_fwstate(mlme, WIFI_STATION_STATE) && check_fwstate(mlme, _FW_LINKED))
 			mlme->auto_scan_int_ms = mlme->roam_scan_int_ms;
 	} else {
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 17/20] staging: rtl8723bs: add blank line after variable declarations
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (15 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 16/20] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 18/20] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Added a blank line after variable declarations in one location to improve
code readability and follow kernel coding style guidelines.

No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 7552f7e4d14a..acacc2806dc9 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1449,6 +1449,7 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 		if (adapter->stapriv.asoc_sta_count == 1) {
 			/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
 			u8 ret = _SUCCESS;
+
 			spin_lock_bh(&pmlmepriv->scanned_queue.lock);
 			/* free old ibss network */
 			pwlan = rtw_find_network(&pmlmepriv->scanned_queue,
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 18/20] staging: rtl8723bs: fix line ending with '('
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (16 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 17/20] staging: rtl8723bs: add blank line after variable declarations Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 19/20] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Fixed a line ending with an opening parenthesis '(' by adjusting
formatting to comply with kernel coding style. No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index acacc2806dc9..ecb7b3823010 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1071,8 +1071,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter,
 	 * 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);
+	translate_percentage_to_dbm(ptarget_wlan->network.phy_info.signal_strength);
 
 	rtw_set_signal_stat_timer(&padapter->recvpriv);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 19/20] staging: rtl8723bs: place constant on right side of comparison
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (17 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 18/20] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-26  4:32 ` [PATCH 20/20] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
  2025-07-31  5:29 ` [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Greg KH
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Placed constant on right side of comparison in one instance to conform
to kernel coding style. No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index ecb7b3823010..dbaaa2357ee5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -746,11 +746,10 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 			} 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)
-					) {
+					    rtw_sitesurvey_cmd(adapter,
+							       &pmlmepriv->assoc_ssid,
+							       1,
+							       NULL, 0) != _SUCCESS) {
 						rtw_set_to_roam(adapter, 0);
 						rtw_free_assoc_resources(adapter, 1);
 						rtw_indicate_disconnect(adapter);
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 20/20] staging: rtl8723bs: merge nested if conditions for clarity and tab problems
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (18 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 19/20] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
@ 2025-07-26  4:32 ` Vivek BalachandharTN
  2025-07-31  5:29 ` [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Greg KH
  20 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-26  4:32 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Merged nested if conditions for clarity and fixed tab indentation in one
place. No functional changes.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index dbaaa2357ee5..7c189a823c00 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1157,8 +1157,8 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 						rtw_free_stainfo(adapter,  pcur_sta);
 
 					ptarget_wlan = rtw_find_network(&pmlmepriv->scanned_queue, pnetwork->network.mac_address);
-					if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
-					    if (ptarget_wlan)
+					if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true &&
+					    ptarget_wlan) {
 						ptarget_wlan->fixed = true;
 					}
 				}
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v1 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  2025-07-26  4:32 ` [PATCH 03/20] staging: rtl8723bs: add blank line after function declaration Vivek BalachandharTN
@ 2025-07-28  4:36   ` Vivek BalachandharTN
  2025-07-30  4:04     ` [PATCH v2 " Vivek BalachandharTN
  0 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-28  4:36 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Add a blank line after the definition of rtw_roaming() to separate it from
the following function (_rtw_roaming()), improving readability and matching
kernel coding style guidelines.

No functional changes.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>

v1: Addressed review comments from Markus Elfring on changing the 
    description of the patch regarding readability and separation between 
    function definitions.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 24e505111f1f..b1a427a655ef 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v1 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-26  4:32 ` [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment Vivek BalachandharTN
@ 2025-07-28  6:35   ` Vivek BalachandharTN
  2025-07-28  6:43     ` [PATCH v2 " Vivek BalachandharTN
  0 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-28  6:35 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, vivek.balachandhar

Removed superfluous parentheses around a function call inside an
if-condition. These extra parentheses are not required and violate
kernel coding style guidelines.

Cleaning them up improves code readability without changing logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>

v2:
- Fixed incorrect wording: the change was not around assignment
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 3702d7e7a954..d845eaecd615 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -700,7 +700,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-28  6:35   ` [PATCH v1 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
@ 2025-07-28  6:43     ` Vivek BalachandharTN
  2025-07-30  8:03       ` [PATCH v3 " Vivek BalachandharTN
  0 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-28  6:43 UTC (permalink / raw)
  To: vivek.balachandhar; +Cc: gregkh, linux-kernel, linux-staging

Removed superfluous parentheses around a function call inside an
if-condition. These extra parentheses are not required and violate
kernel coding style guidelines.

Cleaning them up improves code readability without changing logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>

v1:
- Fixed incorrect wording: the change was not around assignment
- Addressed feedback from Markus Elfring.
v2:
- Mentioned the wrong version number in the previous patch.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 3702d7e7a954..d845eaecd615 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -700,7 +700,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  2025-07-28  4:36   ` [PATCH v1 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming() Vivek BalachandharTN
@ 2025-07-30  4:04     ` Vivek BalachandharTN
  2025-07-30  4:20       ` [PATCH v3 " Vivek BalachandharTN
  0 siblings, 1 reply; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30  4:04 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, Markus.Elfring, vivek.balachandhar

Add a blank line after the definition of rtw_roaming() to separate it from
the following function (_rtw_roaming()), improving readability and matching
kernel coding style guidelines.

No functional changes.

Identified using checkpatch.pl.

Changes since v1:
- Moved the '---' marker line below the Signed-off-by tag as per kernel
  patch formatting rules

v1:
- Addressed review comments from Markus Elfring on changing the description
  of the patch regarding readability and separation between function definitions

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 24e505111f1f..b1a427a655ef 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v3 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  2025-07-30  4:04     ` [PATCH v2 " Vivek BalachandharTN
@ 2025-07-30  4:20       ` Vivek BalachandharTN
  2025-07-30  7:32         ` [PATCH v4 " Vivek BalachandharTN
  2025-07-30 19:06         ` Vivek BalachandharTN
  0 siblings, 2 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30  4:20 UTC (permalink / raw)
  To: gregkh; +Cc: Markus.Elfring, linux-kernel, linux-staging, vivek.balachandhar

Add a blank line after the definition of rtw_roaming() to separate it from
the following function (_rtw_roaming()), improving readability and matching
kernel coding style guidelines.

No functional changes.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
Changes since v2:
- Moved version change notes below the '---' line

v2:
- Moved the '---' marker line below the Signed-off-by tag as per kernel
  patch formatting rules

v1:
- Addressed review comments from Markus Elfring on changing the description
  of the patch regarding readability and separation between function definitions
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 24e505111f1f..b1a427a655ef 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  2025-07-30  4:20       ` [PATCH v3 " Vivek BalachandharTN
@ 2025-07-30  7:32         ` Vivek BalachandharTN
  2025-07-30 19:06         ` Vivek BalachandharTN
  1 sibling, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30  7:32 UTC (permalink / raw)
  To: gregkh; +Cc: vivek.balachandhar, Markus.Elfring, linux-kernel, linux-staging

Add a blank line after the definition of rtw_roaming() to separate it from
the following function (_rtw_roaming()), improving readability and matching
kernel coding style guidelines.

No functional changes.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v4:
- Changed the wording of version from "Changes since v2" to "v3" as per
  Markus Elfring comments.

v3:
- Moved version change notes below the '---' line

v2:
- Moved the '---' marker line below the Signed-off-by tag as per kernel
  patch formatting rules

v1:
- Addressed review comments from Markus Elfring on changing the description
  of the patch regarding readability and separation between function definitions
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 357fc6a56c27..f8680124ce24 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v3 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-28  6:43     ` [PATCH v2 " Vivek BalachandharTN
@ 2025-07-30  8:03       ` Vivek BalachandharTN
  2025-07-30 18:39         ` [PATCH " Vivek BalachandharTN
                           ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30  8:03 UTC (permalink / raw)
  To: gregkh; +Cc: vivek.balachandhar, Markus.Elfring, linux-kernel, linux-staging

The extra parentheses around the function call in the if condition
are redundant according to the kernel coding style. Removing them
improves code readability without affecting the logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v3:
- Improved explanation of why the parentheses were removed as per
  Markus Elfring's suggestion.

v2:
- Mentioned the wrong version number in the previous patch.

v1:
- Fixed incorrect wording: the change was not around assignment
- Addressed feedback from Markus Elfring.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b8d72d28178b..7552f7e4d14a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -699,7 +699,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-30  8:03       ` [PATCH v3 " Vivek BalachandharTN
@ 2025-07-30 18:39         ` Vivek BalachandharTN
  2025-07-30 18:42         ` [PATCH v4 " Vivek BalachandharTN
  2025-07-31  1:57         ` Vivek BalachandharTN
  2 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30 18:39 UTC (permalink / raw)
  To: gregkh; +Cc: Markus.Elfring, linux-kernel, linux-staging, vivek.balachandhar

Remove redundant parentheses from the check_fwstate() call in an if-condition.

These parentheses are not required and violate the kernel coding style.
Dropping them simplifies the expression without changing its logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v4:
- Reword the commit message to clarify location and purpose of removed parentheses
- Use imperative mood as recommended
- Remove ambiguous phrase “around the function call”

v3:
- Improved explanation of why the parentheses were removed as per
  Markus Elfring's suggestion.

v2:
- Mentioned the wrong version number in the previous patch.

v1:
- Fixed incorrect wording: the change was not around assignment
- Addressed feedback from Markus Elfring.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b8d72d28178b..7552f7e4d14a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -699,7 +699,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-30  8:03       ` [PATCH v3 " Vivek BalachandharTN
  2025-07-30 18:39         ` [PATCH " Vivek BalachandharTN
@ 2025-07-30 18:42         ` Vivek BalachandharTN
  2025-07-31  1:57         ` Vivek BalachandharTN
  2 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30 18:42 UTC (permalink / raw)
  To: gregkh; +Cc: Markus.Elfring, linux-kernel, linux-staging, vivek.balachandhar

Remove redundant parentheses from the check_fwstate() call in an if-condition.

These parentheses are not required and violate the kernel coding style.
Dropping them simplifies the expression without changing its logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v4:
- Reword the commit message to clarify location and purpose of removed parentheses
- Use imperative mood as recommended
- Remove ambiguous phrase “around the function call”

v3:
- Improved explanation of why the parentheses were removed as per
  Markus Elfring's suggestion.

v2:
- Mentioned the wrong version number in the previous patch.

v1:
- Fixed incorrect wording: the change was not around assignment
- Addressed feedback from Markus Elfring.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b8d72d28178b..7552f7e4d14a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -699,7 +699,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  2025-07-30  4:20       ` [PATCH v3 " Vivek BalachandharTN
  2025-07-30  7:32         ` [PATCH v4 " Vivek BalachandharTN
@ 2025-07-30 19:06         ` Vivek BalachandharTN
  1 sibling, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-30 19:06 UTC (permalink / raw)
  To: gregkh; +Cc: vivek.balachandhar, Markus.Elfring, linux-kernel, linux-staging

Add a blank line after the definition of rtw_roaming() to separate it from
the following function (_rtw_roaming()), improving readability and matching
kernel coding style guidelines.

No functional changes.

Identified using checkpatch.pl.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v4:
- Reword version note from "Changes since v2" to "v3" for consistency,
  as suggested by Markus Elfring

v3:
- Move version notes below the '---' line

v2:
- Place the '---' marker below the Signed-off-by tag to follow patch
  formatting guidelines

v1:
- Improve patch description for readability and better separation of
  function definitions, as suggested by Markus Elfring
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 357fc6a56c27..f8680124ce24 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -2449,6 +2449,7 @@ void rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 	_rtw_roaming(padapter, tgt_network);
 	spin_unlock_bh(&pmlmepriv->lock);
 }
+
 void _rtw_roaming(struct adapter *padapter, struct wlan_network *tgt_network)
 {
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v4 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-07-30  8:03       ` [PATCH v3 " Vivek BalachandharTN
  2025-07-30 18:39         ` [PATCH " Vivek BalachandharTN
  2025-07-30 18:42         ` [PATCH v4 " Vivek BalachandharTN
@ 2025-07-31  1:57         ` Vivek BalachandharTN
  2 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-31  1:57 UTC (permalink / raw)
  To: gregkh; +Cc: Markus.Elfring, vivek.balachandhar, linux-kernel, linux-staging

Remove redundant parentheses from a function in an if-condition.

These parentheses are not required and violate the kernel coding style.
Dropping them simplifies the expression without changing its logic.

Signed-off-by: Vivek BalachandharTN <vivek.balachandhar@gmail.com>
---
v4:
- Clarify the commit message regarding the removal of redundant parentheses in the
  condition.
- Use imperative mood as recommended.
- Remove ambiguous phrase “around the function call”.

v3:
- Improved explanation of why the parentheses were removed as per
  Markus Elfring's suggestion.

v2:
- Mentioned the wrong version number in the previous patch.

v1:
- Fixed incorrect wording: the change was not around assignment
- Addressed feedback from Markus Elfring.
---
 drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b8d72d28178b..7552f7e4d14a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -699,7 +699,7 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 	rtw_set_signal_stat_timer(&adapter->recvpriv);
 
 	if (pmlmepriv->to_join) {
-		if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) {
+		if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == false) {
 				set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 34+ messages in thread

* Re: [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability
  2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
                   ` (19 preceding siblings ...)
  2025-07-26  4:32 ` [PATCH 20/20] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
@ 2025-07-31  5:29 ` Greg KH
  2025-07-31 13:50   ` Feedback on Patch Submissions Vivek BalachandharTN
  20 siblings, 1 reply; 34+ messages in thread
From: Greg KH @ 2025-07-31  5:29 UTC (permalink / raw)
  To: Vivek BalachandharTN; +Cc: linux-staging, linux-kernel

On Sat, Jul 26, 2025 at 04:31:58AM +0000, Vivek BalachandharTN wrote:
> This patch series includes 20 commits that clean up and improve
> the style and formatting of the rtl8723bs driver in the staging tree.
> The changes address spacing issues, indentation, comment formatting,
> blank lines, and minor code clarity improvements.
> 
> No functional changes are introduced. All commits adhere to the Linux kernel
> coding style guidelines to enhance code readability and maintainability.
> 
> The patches have been tested and are ready for review.
> 
> Vivek BalachandharTN (20):
>   staging: rtl8723bs: fix spacing around operators
>   staging: rtl8723bs: remove unnecessary blank lines around braces
>   staging: rtl8723bs: add blank line after function declaration
>   staging: rtl8723bs: remove unnecessary space after type cast
>   staging: rtl8723bs: remove space before tabs
>   staging: rtl8723bs: fix overlong lines and clarify lengthy comments
>   staging: rtl8723bs: align asterisk in block comment to fix formatting
>   staging: rtl8723bs: fix logical continuation style by moving to
>     previous line
>   staging: rtl8723bs: fix indentation to align with open parenthesis
>   staging: rtl8723bs: adding asterisks in multi-line block comments
>   staging: rtl8723bs: remove space before semicolon
>   staging: rtl8723bs: fix excessive indentation in nested if statement
>   staging: rtl8723bs: fix unbalanced braces around conditional blocks
>   staging: rtl8723bs: remove unnecessary parentheses around assignment
>   staging: rtl8723bs: remove unnecessary braces for single statement
>     blocks
>   staging: rtl8723bs: add braces to all arms of conditional statement
>   staging: rtl8723bs: add blank line after variable declarations
>   staging: rtl8723bs: fix line ending with '('
>   staging: rtl8723bs: place constant on right side of comparison
>   staging: rtl8723bs: merge nested if conditions for clarity and tab
>     problems
> 
>  drivers/staging/rtl8723bs/core/rtw_mlme.c | 506 ++++++++++++----------
>  1 file changed, 285 insertions(+), 221 deletions(-)

I understand wanting to get this right, but it's the middle of the merge
window right now, and you are sending new versions for no obvious
reason.  AND you are sending multiple versions of them.  Right now your
submissions look like this:

  Jul 26 Vivek Balachand (1.9K) [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability
  Jul 26 Vivek Balachand (1.0K) ├─>[PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment
  Jul 28 Vivek Balachand (1.1K) │ └─>[PATCH v1 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 28 Vivek Balachand (1.2K) │   └─>[PATCH v2 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 30 Vivek Balachand (1.3K) │     └─>[PATCH v3 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 31 Vivek Balachand (1.5K) │       ├─>[PATCH v4 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 30 Vivek Balachand (1.5K) │       ├─>[PATCH v4 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 30 Vivek Balachand (1.5K) │       └─>[PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional
  Jul 26 Vivek Balachand (0.9K) ├─>[PATCH 03/20] staging: rtl8723bs: add blank line after function declaration
  Jul 28 Vivek Balachand (1.1K) │ └─>[PATCH v1 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  Jul 30 Vivek Balachand (1.2K) │   └─>[PATCH v2 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  Jul 30 Vivek Balachand (1.3K) │     └─>[PATCH v3 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  Jul 30 Vivek Balachand (1.3K) │       ├─>[PATCH v4 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  Jul 30 Vivek Balachand (1.3K) │       └─>[PATCH v4 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming()
  Jul 26 Vivek Balachand (0.9K) ├─>[PATCH 11/20] staging: rtl8723bs: remove space before semicolon
  Jul 26 Vivek Balachand (2.8K) ├─>[PATCH 10/20] staging: rtl8723bs: adding asterisks in multi-line block comments
  Jul 26 Vivek Balachand (4.0K) ├─>[PATCH 09/20] staging: rtl8723bs: fix indentation to align with open parenthesis
  Jul 26 Vivek Balachand (3.7K) ├─>[PATCH 08/20] staging: rtl8723bs: fix logical continuation style by moving to previous line
  Jul 26 Vivek Balachand (3.7K) ├─>[PATCH 07/20] staging: rtl8723bs: align asterisk in block comment to fix formatting
  Jul 26 Vivek Balachand ( 28K) ├─>[PATCH 06/20] staging: rtl8723bs: fix overlong lines and clarify lengthy comments
  Jul 26 Vivek Balachand (1.0K) ├─>[PATCH 20/20] staging: rtl8723bs: merge nested if conditions for clarity and tab problems
  Jul 26 Vivek Balachand (1.1K) ├─>[PATCH 19/20] staging: rtl8723bs: place constant on right side of comparison
  Jul 26 Vivek Balachand (0.9K) ├─>[PATCH 18/20] staging: rtl8723bs: fix line ending with '('
  Jul 26 Vivek Balachand (4.2K) ├─>[PATCH 05/20] staging: rtl8723bs: remove space before tabs
  Jul 26 Vivek Balachand (0.9K) ├─>[PATCH 17/20] staging: rtl8723bs: add blank line after variable declarations
  Jul 26 Vivek Balachand (1.5K) ├─>[PATCH 16/20] staging: rtl8723bs: add braces to all arms of conditional statement
  Jul 26 Vivek Balachand (1.3K) ├─>[PATCH 15/20] staging: rtl8723bs: remove unnecessary braces for single statement blocks
  Jul 26 Vivek Balachand (1.6K) ├─>[PATCH 04/20] staging: rtl8723bs: remove unnecessary space after type cast
  Jul 26 Vivek Balachand (1.7K) ├─>[PATCH 13/20] staging: rtl8723bs: fix unbalanced braces around conditional blocks
  Jul 26 Vivek Balachand (0.9K) ├─>[PATCH 12/20] staging: rtl8723bs: fix excessive indentation in nested if statement
  Jul 26 Vivek Balachand (7.2K) ├─>[PATCH 02/20] staging: rtl8723bs: remove unnecessary blank lines around braces
  Jul 26 Vivek Balachand ( 12K) └─>[PATCH 01/20] staging: rtl8723bs: fix spacing around operators

If you were sent a patch series like this, what would you do to attempt to
review and/or apply them?

Please relax, wait until after the merge window is over, and then resend a new
series please.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: Feedback on Patch Submissions
  2025-07-31  5:29 ` [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Greg KH
@ 2025-07-31 13:50   ` Vivek BalachandharTN
  0 siblings, 0 replies; 34+ messages in thread
From: Vivek BalachandharTN @ 2025-07-31 13:50 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging, vivek.balachandhar

Hi Greg,

Thanks for your feedback — I understand your concerns now.

Apologies for the excessive revisions and resends during the merge window. I got too focused on addressing review comments quickly and lost sight of the timing and volume.

I'll hold off on resending until after the merge window closes, and will consolidate everything into a clean, single series.

Appreciate your patience, and thanks again for the guidance.

Best regards,  
Vivek BalachandharTN


^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2025-07-31 13:50 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-26  4:31 [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Vivek BalachandharTN
2025-07-26  4:31 ` [PATCH 01/20] staging: rtl8723bs: fix spacing around operators Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 02/20] staging: rtl8723bs: remove unnecessary blank lines around braces Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 03/20] staging: rtl8723bs: add blank line after function declaration Vivek BalachandharTN
2025-07-28  4:36   ` [PATCH v1 03/20] staging: rtl8723bs: add blank line between rtw_roaming() and _rtw_roaming() Vivek BalachandharTN
2025-07-30  4:04     ` [PATCH v2 " Vivek BalachandharTN
2025-07-30  4:20       ` [PATCH v3 " Vivek BalachandharTN
2025-07-30  7:32         ` [PATCH v4 " Vivek BalachandharTN
2025-07-30 19:06         ` Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 04/20] staging: rtl8723bs: remove unnecessary space after type cast Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 05/20] staging: rtl8723bs: remove space before tabs Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 06/20] staging: rtl8723bs: fix overlong lines and clarify lengthy comments Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 07/20] staging: rtl8723bs: align asterisk in block comment to fix formatting Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 08/20] staging: rtl8723bs: fix logical continuation style by moving to previous line Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 09/20] staging: rtl8723bs: fix indentation to align with open parenthesis Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 10/20] staging: rtl8723bs: adding asterisks in multi-line block comments Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 11/20] staging: rtl8723bs: remove space before semicolon Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 12/20] staging: rtl8723bs: fix excessive indentation in nested if statement Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 13/20] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 14/20] staging: rtl8723bs: remove unnecessary parentheses around assignment Vivek BalachandharTN
2025-07-28  6:35   ` [PATCH v1 14/20] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
2025-07-28  6:43     ` [PATCH v2 " Vivek BalachandharTN
2025-07-30  8:03       ` [PATCH v3 " Vivek BalachandharTN
2025-07-30 18:39         ` [PATCH " Vivek BalachandharTN
2025-07-30 18:42         ` [PATCH v4 " Vivek BalachandharTN
2025-07-31  1:57         ` Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 15/20] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 16/20] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 17/20] staging: rtl8723bs: add blank line after variable declarations Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 18/20] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 19/20] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
2025-07-26  4:32 ` [PATCH 20/20] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
2025-07-31  5:29 ` [PATCH 00/20] rtl8723bs: cleanup and style improvements for better readability Greg KH
2025-07-31 13:50   ` Feedback on Patch Submissions Vivek BalachandharTN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).