diff mbox series

[1/4] wifi: mwifiex: remove unnecessary queue empty check

Message ID 20250410-mwifiex-drop-asynchronous-init-v1-1-6a212fa9185e@pengutronix.de (mailing list archive)
State New
Delegated to: Johannes Berg
Headers show
Series wifi: mwifiex: drop asynchronous init waiting code | expand

Checks

Context Check Description
wifibot/fixes_present success Fixes tag not required for -next series
wifibot/series_format warning Target tree name not specified in the subject
wifibot/tree_selection success Guessed tree name to be wireless-next
wifibot/ynl success Generated files up to date; no warnings/errors; no diff in generated;
wifibot/build_clang fail Errors and warnings before: 11 this patch: 13
wifibot/build_32bit fail Errors and warnings before: 0 this patch: 1
wifibot/build_allmodconfig_warn fail Errors and warnings before: 9 this patch: 10
wifibot/build_clang_rust success No Rust files in patch. Skipping build
wifibot/build_tools success No tools touched, skip
wifibot/check_selftest success No net selftest shell script
wifibot/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
wifibot/deprecated_api success None detected
wifibot/header_inline success No static functions without inline keyword in header files
wifibot/kdoc success Errors and warnings before: 0 this patch: 0
wifibot/source_inline success Was 0 now: 0
wifibot/verify_fixes success No Fixes tag
wifibot/verify_signedoff success Signed-off-by tag matches author and committer

Commit Message

Sascha Hauer April 10, 2025, 10:28 a.m. UTC
Since 7bff9c974e1a ("mwifiex: send firmware initialization commands
synchronously") all initialization commands are sent synchronously which
means the command queue is empty when mwifiex_sta_init_cmd() returns. No
need to check for entries in the command code then, so remove the check.

Add a WARN_ON() just in case there is something wrong with the
reasoning.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/net/wireless/marvell/mwifiex/init.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Comments

Francesco Dolcini April 11, 2025, 7:41 a.m. UTC | #1
On Thu, Apr 10, 2025 at 12:28:43PM +0200, Sascha Hauer wrote:
> Since 7bff9c974e1a ("mwifiex: send firmware initialization commands
> synchronously") all initialization commands are sent synchronously which
> means the command queue is empty when mwifiex_sta_init_cmd() returns. No
> need to check for entries in the command code then, so remove the check.
> 
> Add a WARN_ON() just in case there is something wrong with the
> reasoning.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c
index ce0d42e72e946..7877dfe5a2233 100644
--- a/drivers/net/wireless/marvell/mwifiex/init.c
+++ b/drivers/net/wireless/marvell/mwifiex/init.c
@@ -522,15 +522,10 @@  int mwifiex_init_fw(struct mwifiex_adapter *adapter)
 	}
 
 	spin_lock_bh(&adapter->cmd_pending_q_lock);
-	is_cmd_pend_q_empty = list_empty(&adapter->cmd_pending_q);
+	WARN_ON(!list_empty(&adapter->cmd_pending_q));
 	spin_unlock_bh(&adapter->cmd_pending_q_lock);
-	if (!is_cmd_pend_q_empty) {
-		/* Send the first command in queue and return */
-		if (mwifiex_main_process(adapter) != -1)
-			ret = -EINPROGRESS;
-	} else {
-		adapter->hw_status = MWIFIEX_HW_STATUS_READY;
-	}
+
+	adapter->hw_status = MWIFIEX_HW_STATUS_READY;
 
 	return ret;
 }