public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Vasilije Knezevic <vasilijeknezevic.dev@gmail.com>
To: linux-staging@lists.linux.dev
Cc: Vasilije Knezevic <vasilijeknezevic.dev@gmail.com>
Subject: [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog
Date: Sun, 19 Apr 2026 13:01:51 +0200	[thread overview]
Message-ID: <20260419110151.5689-1-vasilijeknezevic.dev@gmail.com> (raw)

 - Rename bAllow to allow_pre_init_cmd
 - Convert traffic flags to bool where appropriate
 - Improve comments for traffic detection logic

 No functional change.

Signed-off-by: Vasilije Knezevic <vasilijeknezevic.dev@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_cmd.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index abb84f8aecbe..e0c57652e0f5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -298,12 +298,13 @@ void rtw_free_cmd_priv(struct	cmd_priv *pcmdpriv)
 int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
 int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
 {
-	u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
+	/* set to true to allow enqueuing cmd when hw_init_completed is false */
+	bool allow_pre_init_cmd = false;
 
 	if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
-		bAllow = true;
+		allow_pre_init_cmd = true;
 
-	if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
+	if ((!pcmdpriv->padapter->hw_init_completed && !allow_pre_init_cmd) ||
 	    !atomic_read(&pcmdpriv->cmdthd_running))	/* com_thread not running */
 		return _FAIL;
 
@@ -1127,12 +1128,16 @@ static void collect_traffic_statistics(struct adapter *padapter)
 
 u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 {
-	u8 bEnterPS = false;
+	bool bEnterPS = false;
 	u16 BusyThresholdHigh = 25;
 	u16 BusyThresholdLow = 10;
 	u16 BusyThreshold = BusyThresholdHigh;
-	u8 bBusyTraffic = false, bTxBusyTraffic = false, bRxBusyTraffic = false;
-	u8 bHigherBusyTraffic = false, bHigherBusyRxTraffic = false, bHigherBusyTxTraffic = false;
+	u8 bBusyTraffic = false;
+	u8 bTxBusyTraffic = false;
+	u8 bRxBusyTraffic = false;
+	u8 bHigherBusyTraffic = false;
+	u8 bHigherBusyRxTraffic = false;
+	u8 bHigherBusyTxTraffic = false;
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	collect_traffic_statistics(padapter);
@@ -1156,7 +1161,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 				bTxBusyTraffic = true;
 		}
 
-		/*  Higher Tx/Rx data. */
+		/*  Detect high Tx/Rx traffic load. */
 		if (pmlmepriv->LinkDetectInfo.NumRxOkInPeriod > 4000 ||
 		    pmlmepriv->LinkDetectInfo.NumTxOkInPeriod > 4000) {
 			bHigherBusyTraffic = true;
@@ -1191,7 +1196,7 @@ u8 traffic_status_watchdog(struct adapter *padapter, u8 from_timer)
 				bEnterPS = true;
 		}
 
-		/*  LeisurePS only work in infra mode. */
+		/*  LeisurePS based on traffic state (infra mode only) */
 		if (bEnterPS) {
 			if (!from_timer)
 				LPS_Enter(padapter, "TRAFFIC_IDLE");
-- 
2.47.3


             reply	other threads:[~2026-04-19 11:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-19 11:01 Vasilije Knezevic [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-04-18 23:24 [PATCH] rtl8723bs: improve readability in cmd filter and traffic watchdog Vakii
2026-04-19  5:34 ` Greg KH

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=20260419110151.5689-1-vasilijeknezevic.dev@gmail.com \
    --to=vasilijeknezevic.dev@gmail.com \
    --cc=linux-staging@lists.linux.dev \
    /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