Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks
@ 2025-09-04  1:28 Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Balance braces in conditional blocks to match kernel coding style and
prevent potential confusion. This improves code structure and readability.

No functional changes.

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 a2b1e34765ac..050fc54e251b 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -785,8 +785,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);
 			}
@@ -1674,8 +1675,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)
@@ -2412,9 +2414,10 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
 			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] 7+ messages in thread

* [PATCH 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

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>
---
 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 050fc54e251b..ef9057456768 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -730,7 +730,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] 7+ messages in thread

* [PATCH 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 13/16] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Drop braces around conditional blocks that contain only a single
statement, as required by kernel coding style. This enhances clarity
and reduces visual clutter.

No functional changes.

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 ef9057456768..27be46c11b65 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -514,9 +514,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;
@@ -2546,9 +2545,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] 7+ messages in thread

* [PATCH 13/16] staging: rtl8723bs: add braces to all arms of conditional statement
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 14/16] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Add braces consistently to all branches of conditional statements to
prevent potential future errors when modifying or extending logic.
This aligns with kernel coding style recommendations for clarity and
maintainability.

No functional changes.

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 27be46c11b65..25f333bb0816 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1667,11 +1667,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] 7+ messages in thread

* [PATCH 14/16] staging: rtl8723bs: fix line ending with '('
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
                   ` (2 preceding siblings ...)
  2025-09-04  1:28 ` [PATCH 13/16] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 15/16] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 16/16] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Adjust formatting to avoid a line ending with an opening parenthesis,
in compliance 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 25f333bb0816..2c34b68f1d60 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1112,8 +1112,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter,
 	 * 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] 7+ messages in thread

* [PATCH 15/16] staging: rtl8723bs: place constant on right side of comparison
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
                   ` (3 preceding siblings ...)
  2025-09-04  1:28 ` [PATCH 14/16] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  2025-09-04  1:28 ` [PATCH 16/16] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Reorder comparison to place the constant on the right side, in
conformance with kernel coding style.

No functional changes.

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

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 2c34b68f1d60..80b4dd1e8353 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -775,9 +775,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] 7+ messages in thread

* [PATCH 16/16] staging: rtl8723bs: merge nested if conditions for clarity and tab problems
  2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
                   ` (4 preceding siblings ...)
  2025-09-04  1:28 ` [PATCH 15/16] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
@ 2025-09-04  1:28 ` Vivek BalachandharTN
  5 siblings, 0 replies; 7+ messages in thread
From: Vivek BalachandharTN @ 2025-09-04  1:28 UTC (permalink / raw)
  To: gregkh; +Cc: linux-staging, linux-kernel, Vivek BalachandharTN

Combine nested if conditions for clarity and fix tab indentation in one
place to match kernel coding style.

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 80b4dd1e8353..4fbb180398b0 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1253,8 +1253,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] 7+ messages in thread

end of thread, other threads:[~2025-09-04  1:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04  1:28 [PATCH 10/16] staging: rtl8723bs: fix unbalanced braces around conditional blocks Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 11/16] staging: rtl8723bs: remove unnecessary parentheses in conditional Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 12/16] staging: rtl8723bs: remove unnecessary braces for single statement blocks Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 13/16] staging: rtl8723bs: add braces to all arms of conditional statement Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 14/16] staging: rtl8723bs: fix line ending with '(' Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 15/16] staging: rtl8723bs: place constant on right side of comparison Vivek BalachandharTN
2025-09-04  1:28 ` [PATCH 16/16] staging: rtl8723bs: merge nested if conditions for clarity and tab problems Vivek BalachandharTN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox