* [PATCH] staging: rtl8723bs: fix coding style issues in rtw_mlme.c
@ 2026-01-23 0:32 Michael Huang
2026-01-23 8:57 ` Dan Carpenter
0 siblings, 1 reply; 6+ messages in thread
From: Michael Huang @ 2026-01-23 0:32 UTC (permalink / raw)
To: gregkh; +Cc: straube.linux, hansg, linux-staging, linux-kernel, Michael Huang
This patch fixes several checkpatch.pl issues:
1. Remove redundant else after break/return.
2. Remove unnecessary boolean comparisons (== true/false).
3. Fix trailing whitespaces and overly deep indentation.
Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 98704179ad35..71a0efe49bdd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -710,8 +710,8 @@ 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, _FW_LINKED) == false) {
+ if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+ if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
if (rtw_select_and_join_from_scanned_queue(pmlmepriv) == _SUCCESS) {
@@ -1206,10 +1206,9 @@ 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)
- ptarget_wlan->fixed = true;
- }
+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
+ ptarget_wlan)
+ ptarget_wlan->fixed = true;
}
} else {
@@ -1560,10 +1559,6 @@ void _rtw_join_timeout_handler(struct timer_list *t)
do_join_r = rtw_do_join(adapter);
if (do_join_r != _SUCCESS)
continue;
-
- break;
- } else {
- rtw_indicate_disconnect(adapter);
break;
}
}
@@ -2018,7 +2013,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
return ielength;
}
-/* Ported from 8185: IsInPreAuthKeyList().
+/* Ported from 8185: IsInPreAuthKeyList().
* (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.)
* Added by Annie, 2006-05-07.
*
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH] staging: rtl8723bs: fix coding style issues in rtw_mlme.c
2026-01-23 0:32 [PATCH] staging: rtl8723bs: fix coding style issues in rtw_mlme.c Michael Huang
@ 2026-01-23 8:57 ` Dan Carpenter
2026-01-23 9:57 ` [PATCH v2 0/2] staging: rtl8723bs: fix coding style and logic " Michael Huang
0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2026-01-23 8:57 UTC (permalink / raw)
To: Michael Huang; +Cc: gregkh, straube.linux, hansg, linux-staging, linux-kernel
On Thu, Jan 22, 2026 at 04:32:05PM -0800, Michael Huang wrote:
> This patch fixes several checkpatch.pl issues:
> 1. Remove redundant else after break/return.
> 2. Remove unnecessary boolean comparisons (== true/false).
> 3. Fix trailing whitespaces and overly deep indentation.
>
> Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
Split this up into multiple patches.
> @@ -1560,10 +1559,6 @@ void _rtw_join_timeout_handler(struct timer_list *t)
> do_join_r = rtw_do_join(adapter);
> if (do_join_r != _SUCCESS)
> continue;
> -
> - break;
> - } else {
> - rtw_indicate_disconnect(adapter);
> break;
> }
> }
You accidentally deleted some important stuff here.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 0/2] staging: rtl8723bs: fix coding style and logic in rtw_mlme.c
2026-01-23 8:57 ` Dan Carpenter
@ 2026-01-23 9:57 ` Michael Huang
2026-01-23 9:57 ` [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces Michael Huang
2026-01-23 9:57 ` [PATCH v2 2/2] staging: rtl8723bs: remove redundant else after break Michael Huang
0 siblings, 2 replies; 6+ messages in thread
From: Michael Huang @ 2026-01-23 9:57 UTC (permalink / raw)
To: gregkh
Cc: dan.carpenter, straube.linux, hansg, linux-staging, linux-kernel,
Michael Huang
This patch series fixes several checkpatch.pl issues in rtw_mlme.c.
The previous single patch has been split into a series of two patches
to separate pure style cleanups from structural refactoring.
A logic regression in _rtw_join_timeout_handler() from the first
version has also been corrected.
Changes in v2:
- Split the original patch into two separate commits.
- Restored the call to rtw_indicate_disconnect() which was accidentally
removed in the first version.
- Improved commit descriptions for both patches.
Michael Huang (2):
staging: rtl8723bs: remove unnecessary boolean comparisons and
whitespaces
staging: rtl8723bs: remove redundant else after break
drivers/staging/rtl8723bs/core/rtw_mlme.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces
2026-01-23 9:57 ` [PATCH v2 0/2] staging: rtl8723bs: fix coding style and logic " Michael Huang
@ 2026-01-23 9:57 ` Michael Huang
2026-01-27 14:42 ` Greg KH
2026-01-23 9:57 ` [PATCH v2 2/2] staging: rtl8723bs: remove redundant else after break Michael Huang
1 sibling, 1 reply; 6+ messages in thread
From: Michael Huang @ 2026-01-23 9:57 UTC (permalink / raw)
To: gregkh
Cc: dan.carpenter, straube.linux, hansg, linux-staging, linux-kernel,
Michael Huang
According to the kernel coding style, explicit comparisons with true
or false are redundant and should be avoided. This patch removes these
comparisons in rtw_mlme.c to improve code clarity. Additionally,
trailing whitespaces are removed to satisfy checkpatch.pl requirements.
Signed-off-by: Michael Huang <tehsiu.huang@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 98704179ad35..ed754fdbfe7a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -710,8 +710,8 @@ 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, _FW_LINKED) == false) {
+ if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+ if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
if (rtw_select_and_join_from_scanned_queue(pmlmepriv) == _SUCCESS) {
@@ -1206,10 +1206,9 @@ 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)
- ptarget_wlan->fixed = true;
- }
+ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
+ ptarget_wlan)
+ ptarget_wlan->fixed = true;
}
} else {
@@ -2018,7 +2017,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_
return ielength;
}
-/* Ported from 8185: IsInPreAuthKeyList().
+/* Ported from 8185: IsInPreAuthKeyList().
* (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.)
* Added by Annie, 2006-05-07.
*
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces
2026-01-23 9:57 ` [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces Michael Huang
@ 2026-01-27 14:42 ` Greg KH
0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2026-01-27 14:42 UTC (permalink / raw)
To: Michael Huang
Cc: dan.carpenter, straube.linux, hansg, linux-staging, linux-kernel
On Fri, Jan 23, 2026 at 01:57:32AM -0800, Michael Huang wrote:
> According to the kernel coding style, explicit comparisons with true
> or false are redundant and should be avoided. This patch removes these
> comparisons in rtw_mlme.c to improve code clarity. Additionally,
> trailing whitespaces are removed to satisfy checkpatch.pl requirements.
That is two different things in one patch, please do not do that.
Remember, only one logical change per patch.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 2/2] staging: rtl8723bs: remove redundant else after break
2026-01-23 9:57 ` [PATCH v2 0/2] staging: rtl8723bs: fix coding style and logic " Michael Huang
2026-01-23 9:57 ` [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces Michael Huang
@ 2026-01-23 9:57 ` Michael Huang
1 sibling, 0 replies; 6+ messages in thread
From: Michael Huang @ 2026-01-23 9:57 UTC (permalink / raw)
To: gregkh
Cc: dan.carpenter, straube.linux, hansg, linux-staging, linux-kernel,
Michael Huang
In _rtw_join_timeout_handler(), an else statement followed a break
in the previous logic. Removing this else reduces the indentation
level of the following code and makes the function easier to read,
while maintaining the original logic by ensuring that disconnect
indication is still called when roaming fails.
Signed-off-by: Michael Huang <tehsiu.huang@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 ed754fdbfe7a..ac47b2a4f65f 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1559,12 +1559,10 @@ void _rtw_join_timeout_handler(struct timer_list *t)
do_join_r = rtw_do_join(adapter);
if (do_join_r != _SUCCESS)
continue;
-
- break;
- } else {
- rtw_indicate_disconnect(adapter);
break;
}
+ rtw_indicate_disconnect(adapter);
+ break;
}
} else {
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-27 14:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 0:32 [PATCH] staging: rtl8723bs: fix coding style issues in rtw_mlme.c Michael Huang
2026-01-23 8:57 ` Dan Carpenter
2026-01-23 9:57 ` [PATCH v2 0/2] staging: rtl8723bs: fix coding style and logic " Michael Huang
2026-01-23 9:57 ` [PATCH v2 1/2] staging: rtl8723bs: remove unnecessary boolean comparisons and whitespaces Michael Huang
2026-01-27 14:42 ` Greg KH
2026-01-23 9:57 ` [PATCH v2 2/2] staging: rtl8723bs: remove redundant else after break Michael Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox