From: Khushal Chitturi <khushalchitturi@gmail.com>
To: gregkh@linuxfoundation.org
Cc: dan.carpenter@linaro.org, straube.linux@gmail.com,
hansg@kernel.org, ethantidmore06@gmail.com,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Khushal Chitturi <khushalchitturi@gmail.com>
Subject: [PATCH v7 6/7] staging: rtl8723bs: simplify boolean expressions
Date: Thu, 12 Feb 2026 19:51:30 +0530 [thread overview]
Message-ID: <20260212142131.28131-7-khushalchitturi@gmail.com> (raw)
In-Reply-To: <20260212142131.28131-1-khushalchitturi@gmail.com>
Remove redundant comparisons with true/false and simplify
boolean conditions.
Signed-off-by: Khushal Chitturi <khushalchitturi@gmail.com>
---
Changelog:
v6 -> v7: new patch applying boolean simplifications to renamed code.
drivers/staging/rtl8723bs/core/rtw_cmd.c | 9 ++++++---
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 13 +++++--------
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index c50a3a2997e2..f322a7f89b42 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1150,7 +1150,8 @@ bool traffic_status_watchdog(struct adapter *padapter, bool from_timer)
pmlmepriv->link_detect_info.num_tx_ok_in_period > busy_threshold) {
busy_traffic = true;
- if (pmlmepriv->link_detect_info.num_rx_ok_in_period > pmlmepriv->link_detect_info.num_tx_ok_in_period)
+ if (pmlmepriv->link_detect_info.num_rx_ok_in_period >
+ pmlmepriv->link_detect_info.num_tx_ok_in_period)
rx_busy_traffic = true;
else
tx_busy_traffic = true;
@@ -1161,14 +1162,16 @@ bool traffic_status_watchdog(struct adapter *padapter, bool from_timer)
pmlmepriv->link_detect_info.num_tx_ok_in_period > 4000) {
higher_busy_traffic = true;
- if (pmlmepriv->link_detect_info.num_rx_ok_in_period > pmlmepriv->link_detect_info.num_tx_ok_in_period)
+ if (pmlmepriv->link_detect_info.num_rx_ok_in_period >
+ pmlmepriv->link_detect_info.num_tx_ok_in_period)
higher_busy_rx_traffic = true;
else
higher_busy_tx_traffic = true;
}
/* check traffic for powersaving. */
- if (((pmlmepriv->link_detect_info.num_rx_unicast_ok_in_period + pmlmepriv->link_detect_info.num_tx_ok_in_period) > 8) ||
+ if (((pmlmepriv->link_detect_info.num_rx_unicast_ok_in_period +
+ pmlmepriv->link_detect_info.num_tx_ok_in_period) > 8) ||
(pmlmepriv->link_detect_info.num_rx_unicast_ok_in_period > 2)) {
should_enter_ps = false;
diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index c41595d03c08..d92ec9949d00 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -61,9 +61,7 @@ u8 rtw_do_join(struct adapter *padapter)
/* when set_ssid/set_bssid for rtw_do_join(), but scanning queue is empty */
/* we try to issue sitesurvey firstly */
- if (pmlmepriv->link_detect_info.busy_traffic == false
- || rtw_to_roam(padapter) > 0
- ) {
+ if (!pmlmepriv->link_detect_info.busy_traffic || rtw_to_roam(padapter) > 0) {
/* submit site_survey_cmd */
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
if (ret != _SUCCESS)
@@ -113,9 +111,8 @@ u8 rtw_do_join(struct adapter *padapter)
/* when set_ssid/set_bssid for rtw_do_join(), but there are no desired bss in scanning queue */
/* we try to issue sitesurvey firstly */
- if (pmlmepriv->link_detect_info.busy_traffic == false
- || rtw_to_roam(padapter) > 0
- ) {
+ if (!pmlmepriv->link_detect_info.busy_traffic ||
+ rtw_to_roam(padapter) > 0) {
ret = rtw_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid, 1, NULL, 0);
if (ret != _SUCCESS)
pmlmepriv->to_join = false;
@@ -379,8 +376,8 @@ u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_s
goto exit;
}
- if ((check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == true) ||
- (pmlmepriv->link_detect_info.busy_traffic == true)) {
+ if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING) ||
+ pmlmepriv->link_detect_info.busy_traffic) {
/* Scan or linking is in progress, do nothing. */
res = true;
diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 983669189d41..f0e423cf7627 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -1231,7 +1231,7 @@ static int cfg80211_rtw_scan(struct wiphy *wiphy
goto check_need_indicate_scan_done;
}
- if (pmlmepriv->link_detect_info.busy_traffic == true) {
+ if (pmlmepriv->link_detect_info.busy_traffic) {
static unsigned long lastscantime;
unsigned long passtime;
--
2.52.0
next prev parent reply other threads:[~2026-02-12 14:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 14:21 [PATCH v7 0/7] staging: rtl8723bs: coding style and refactoring cleanups Khushal Chitturi
2026-02-12 14:21 ` [PATCH v7 1/7] staging: rtl8723bs: rename LinkDetectInfo to link_detect_info Khushal Chitturi
2026-02-12 14:21 ` [PATCH v7 2/7] staging: rtl8723bs: rename rt_link_detect_t fields to snake_case Khushal Chitturi
2026-02-12 14:21 ` [PATCH v7 3/7] staging: rtl8723bs: convert traffic_status_watchdog() local variables " Khushal Chitturi
2026-02-12 14:21 ` [PATCH v7 4/7] staging: rtl8723bs: remove stale commented code Khushal Chitturi
2026-02-12 14:21 ` [PATCH v7 5/7] staging: rtl8723bs: use bool for traffic_status_watchdog() Khushal Chitturi
2026-02-12 14:21 ` Khushal Chitturi [this message]
2026-02-12 14:21 ` [PATCH v7 7/7] staging: rtl8723bs: align and split variable declarations Khushal Chitturi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260212142131.28131-7-khushalchitturi@gmail.com \
--to=khushalchitturi@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=ethantidmore06@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hansg@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=straube.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox