mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 07:51:31 -04:00
staging: rtl8723bs: simplify boolean expressions
Remove redundant comparisons with true/false and simplify boolean conditions. Signed-off-by: Khushal Chitturi <khushalchitturi@gmail.com> Link: https://patch.msgid.link/20260212142131.28131-7-khushalchitturi@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2b8144be61
commit
2ad4e71ec9
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user