[PATCH v6 2/4] staging: rtl8723bs: convert traffic status variables to bool

Khushal Chitturi posted 4 patches 1 week ago
[PATCH v6 2/4] staging: rtl8723bs: convert traffic status variables to bool
Posted by Khushal Chitturi 1 week ago
This patch replaces u8 variables in traffic_status_watchdog() and its
callers with bool to reflect their usage.

Signed-off-by: Khushal Chitturi <khushalchitturi@gmail.com>

---
Changelog:
v5 -> v6: Add new patch to convert traffic_status_watchdog variables
from u8 to bool

 drivers/staging/rtl8723bs/core/rtw_cmd.c         | 16 ++++++++--------
 drivers/staging/rtl8723bs/core/rtw_mlme.c        |  7 +++----
 drivers/staging/rtl8723bs/include/rtw_mlme_ext.h |  2 +-
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index ab3c7d3846b5..a8254616cd36 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1128,18 +1128,18 @@ static void collect_traffic_statistics(struct adapter *padapter)
 	pdvobjpriv->traffic_stat.cur_rx_tp = (u32)(pdvobjpriv->traffic_stat.cur_rx_bytes * 8 / 2 / 1024 / 1024);
 }
 
-u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
+bool traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 {
-	u8 should_enter_ps = false;
+	bool should_enter_ps = false;
 	u16 busy_threshold_high = 25;
 	u16 busy_threshold_low = 10;
 	u16 busy_threshold = busy_threshold_high;
-	u8 busy_traffic = false;
-	u8 tx_busy_traffic = false;
-	u8 rx_busy_traffic = false;
-	u8 higher_busy_traffic = false;
-	u8 higher_busy_rx_traffic = false;
-	u8 higher_busy_tx_traffic = false;
+	bool busy_traffic = false;
+	bool tx_busy_traffic = false;
+	bool rx_busy_traffic = false;
+	bool higher_busy_traffic = false;
+	bool higher_busy_rx_traffic = false;
+	bool higher_busy_tx_traffic = false;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	collect_traffic_statistics(padapter);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 4088a1aaae3c..e9287e2b2eee 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1652,10 +1652,9 @@ 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))
-		) {
-		u8 should_enter_ps;
+	if (adapter_to_pwrctl(adapter)->fw_current_in_ps_mode &&
+	    !hal_btcoex_IsBtControlLps(adapter)) {
+		bool should_enter_ps;
 
 		linked_status_chk(adapter);
 
diff --git a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
index dd5080056e58..4119d7b6d6db 100644
--- a/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
+++ b/drivers/staging/rtl8723bs/include/rtw_mlme_ext.h
@@ -615,7 +615,7 @@ extern void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr
 extern void update_TSF(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
 extern void correct_TSF(struct adapter *padapter, struct mlme_ext_priv *pmlmeext);
 extern void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len);
-extern u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer);
+extern bool traffic_status_watchdog(struct adapter *padapter, u8 from_timer);
 
 int rtw_chk_start_clnt_join(struct adapter *padapter, u8 *ch, u8 *bw, u8 *offset);
 
-- 
2.52.0