From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14F4C26F45E for ; Thu, 10 Apr 2025 10:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; cv=none; b=YsiGHOjRbR+L96HlhtJkW+uQZjlCRaMnE/qqhIwqC8YdoPM+PTa+XKQxynSsb9NTGXprNZID+wPBwl0QXgScdKaTj4xstvXtTOggq0kk+DtRjQjNTz3Rxl2VZADvfg0fFq8f+XivjX2AnKkt9NquC8AKCWc1frbG3stM9NnQMsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; c=relaxed/simple; bh=g2pl9iqknXu1keQDFtkQe/FWicyGBdTdZMge1Vh6+sk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=b/AjA47OGseJPXCGvxRWqlGOQi1V/FtMvowCjaHI6vC9t9T7CquJYvpnn/Tk/6+/lz1BJ4vqZkdtIJ7ZMSxQef/sWE3EsPnbBa4RMbbVW9BuxVLCiJIgTfWc3KaXRE3vvpgAJJyg0isyT82XqsY6scdPh/B6o9JvuPKI3RXJ5vc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DD-5i; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmu-2a; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2H; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:25 +0200 Subject: [PATCH wireless-next v6 1/9] wifi: mwifiex: deduplicate code in mwifiex_cmd_tx_rate_cfg() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-1-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=3222; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=g2pl9iqknXu1keQDFtkQe/FWicyGBdTdZMge1Vh6+sk=; b=f9bl0CbD84oqtha8MYCEhM9cxt07+Qh7TlfB2T/lWiNFOcjuXFXbeXTbwfO2ghShB67nYfy30 OMrOU3pUgEzBHYZn2OTuE/HiHs3qIYCJrZm3gvggfR+ux97jkrZEf03 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org The code block inside the if/else is the same with just using pbitmap_rates if non NULL or priv->bitmap_rates otherwise. Deduplicate the code by picking the correct pointer first and then using it unconditionally. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 43 +++++++++-------------= ---- 1 file changed, 14 insertions(+), 29 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c b/drivers/net/w= ireless/marvell/mwifiex/sta_cmd.c index c4689f5a1acc8..f2e9f582ae818 100644 --- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c @@ -157,7 +157,7 @@ mwifiex_cmd_802_11_get_log(struct host_cmd_ds_command *= cmd) */ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_private *priv, struct host_cmd_ds_command *cmd, - u16 cmd_action, u16 *pbitmap_rates) + u16 cmd_action, const u16 *pbitmap_rates) { struct host_cmd_ds_tx_rate_cfg *rate_cfg =3D &cmd->params.tx_rate_cfg; struct mwifiex_rate_scope *rate_scope; @@ -174,34 +174,19 @@ static int mwifiex_cmd_tx_rate_cfg(struct mwifiex_pri= vate *priv, rate_scope->type =3D cpu_to_le16(TLV_TYPE_RATE_SCOPE); rate_scope->length =3D cpu_to_le16 (sizeof(*rate_scope) - sizeof(struct mwifiex_ie_types_header)); - if (pbitmap_rates !=3D NULL) { - rate_scope->hr_dsss_rate_bitmap =3D cpu_to_le16(pbitmap_rates[0]); - rate_scope->ofdm_rate_bitmap =3D cpu_to_le16(pbitmap_rates[1]); - for (i =3D 0; i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); i++) - rate_scope->ht_mcs_rate_bitmap[i] =3D - cpu_to_le16(pbitmap_rates[2 + i]); - if (priv->adapter->fw_api_ver =3D=3D MWIFIEX_FW_V15) { - for (i =3D 0; - i < ARRAY_SIZE(rate_scope->vht_mcs_rate_bitmap); - i++) - rate_scope->vht_mcs_rate_bitmap[i] =3D - cpu_to_le16(pbitmap_rates[10 + i]); - } - } else { - rate_scope->hr_dsss_rate_bitmap =3D - cpu_to_le16(priv->bitmap_rates[0]); - rate_scope->ofdm_rate_bitmap =3D - cpu_to_le16(priv->bitmap_rates[1]); - for (i =3D 0; i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); i++) - rate_scope->ht_mcs_rate_bitmap[i] =3D - cpu_to_le16(priv->bitmap_rates[2 + i]); - if (priv->adapter->fw_api_ver =3D=3D MWIFIEX_FW_V15) { - for (i =3D 0; - i < ARRAY_SIZE(rate_scope->vht_mcs_rate_bitmap); - i++) - rate_scope->vht_mcs_rate_bitmap[i] =3D - cpu_to_le16(priv->bitmap_rates[10 + i]); - } + if (!pbitmap_rates) + pbitmap_rates =3D priv->bitmap_rates; + + rate_scope->hr_dsss_rate_bitmap =3D cpu_to_le16(pbitmap_rates[0]); + rate_scope->ofdm_rate_bitmap =3D cpu_to_le16(pbitmap_rates[1]); + + for (i =3D 0; i < ARRAY_SIZE(rate_scope->ht_mcs_rate_bitmap); i++) + rate_scope->ht_mcs_rate_bitmap[i] =3D cpu_to_le16(pbitmap_rates[2 + i]); + + if (priv->adapter->fw_api_ver =3D=3D MWIFIEX_FW_V15) { + for (i =3D 0; i < ARRAY_SIZE(rate_scope->vht_mcs_rate_bitmap); i++) + rate_scope->vht_mcs_rate_bitmap[i] =3D + cpu_to_le16(pbitmap_rates[10 + i]); } =20 rate_drop =3D (struct mwifiex_rate_drop_pattern *) ((u8 *) rate_scope + --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 955DA281511 for ; Thu, 10 Apr 2025 10:24:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280694; cv=none; b=ioCP51A8laNz4guaakZdnr04ChCCpxReG9dL1084Ys1HKg7L+gielazHr0ReuxTF/ZxDbZFaLmj6gjSl+gTt11cSyrVBKGTlUaelQNyWJQy1p9O1PZ5xSqfZFHbgav3lJC82wgOiZiuILo6ZzWoSH6AzT5Q5vq8sSdc97czFtbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280694; c=relaxed/simple; bh=sTpc2b8bbM7EJ5rOPTmhe/8vAh34UMl26UbwJ2fJPKU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IoPqR8oHmlCljjOSQDE5HTPEaZipVnhSAKZBQAX9QSNq9TmX7tg0hpyUQ6LYa7xplhx1bWhTqEWbDpAyEWatLIBPW8R+36yiDx1h/YKvXs6lKLURViJ1sf03DxdI+IlnPBM37Ur8WyuIaqWIcmN9XKFR5YdJw4tZ9Xfj2Y6L2kM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DF-5h; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmv-2Z; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2I; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:26 +0200 Subject: [PATCH wireless-next v6 2/9] wifi: mwifiex: use adapter as context pointer for mwifiex_hs_activated_event() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-2-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=7387; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=sTpc2b8bbM7EJ5rOPTmhe/8vAh34UMl26UbwJ2fJPKU=; b=b+/QVShwhY6CG57ALfcKn1v/bQG3sWqGFHbdZfXDkcW7pFbrfHV8IPK6UZw3qBeJYbTC3da1j XonIhzBcUH/D0UjU0IxSn6Hg12Om0fRTwo/nqYc7swKwhRXUQsFm8i3 X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org mwifiex_hs_activated_event() takes a struct mwifiex_private * as context pointer which this function doesn't need directly and the callers don't have. Use struct mwifiex_adapter * instead to simplify both the function and the callers. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 44 ++++++++++++-----------= ---- drivers/net/wireless/marvell/mwifiex/main.c | 15 ++------- drivers/net/wireless/marvell/mwifiex/main.h | 2 +- 3 files changed, 23 insertions(+), 38 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wi= reless/marvell/mwifiex/cmdevt.c index 5573e2ded72f2..ee3ec80ae3a46 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -367,8 +367,7 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifie= x_adapter *adapter) (test_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags) && !adapter->sleep_period.period)) { adapter->pm_wakeup_card_req =3D true; - mwifiex_hs_activated_event(mwifiex_get_priv - (adapter, MWIFIEX_BSS_ROLE_ANY), true); + mwifiex_hs_activated_event(adapter, true); } =20 return ret; @@ -784,17 +783,16 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *ada= pter) =20 spin_unlock_bh(&adapter->mwifiex_cmd_lock); ret =3D mwifiex_dnld_cmd_to_fw(priv, cmd_node); - priv =3D mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); + /* Any command sent to the firmware when host is in sleep * mode should de-configure host sleep. We should skip the * host sleep configuration command itself though */ - if (priv && (host_cmd->command !=3D - cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH))) { + if (host_cmd->command !=3D cpu_to_le16(HostCmd_CMD_802_11_HS_CFG_ENH)) { if (adapter->hs_activated) { clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); - mwifiex_hs_activated_event(priv, false); + mwifiex_hs_activated_event(adapter, false); } } =20 @@ -1160,27 +1158,27 @@ mwifiex_check_ps_cond(struct mwifiex_adapter *adapt= er) * This event is generated by the driver, with a blank event body. */ void -mwifiex_hs_activated_event(struct mwifiex_private *priv, u8 activated) +mwifiex_hs_activated_event(struct mwifiex_adapter *adapter, u8 activated) { if (activated) { if (test_bit(MWIFIEX_IS_HS_CONFIGURED, - &priv->adapter->work_flags)) { - priv->adapter->hs_activated =3D true; - mwifiex_update_rxreor_flags(priv->adapter, + &adapter->work_flags)) { + adapter->hs_activated =3D true; + mwifiex_update_rxreor_flags(adapter, RXREOR_FORCE_NO_DROP); - mwifiex_dbg(priv->adapter, EVENT, + mwifiex_dbg(adapter, EVENT, "event: hs_activated\n"); - priv->adapter->hs_activate_wait_q_woken =3D true; + adapter->hs_activate_wait_q_woken =3D true; wake_up_interruptible( - &priv->adapter->hs_activate_wait_q); + &adapter->hs_activate_wait_q); } else { - mwifiex_dbg(priv->adapter, EVENT, + mwifiex_dbg(adapter, EVENT, "event: HS not configured\n"); } } else { - mwifiex_dbg(priv->adapter, EVENT, + mwifiex_dbg(adapter, EVENT, "event: hs_deactivated\n"); - priv->adapter->hs_activated =3D false; + adapter->hs_activated =3D false; } } =20 @@ -1204,7 +1202,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private = *priv, =20 if (phs_cfg->action =3D=3D cpu_to_le16(HS_ACTIVATE) && adapter->iface_type !=3D MWIFIEX_USB) { - mwifiex_hs_activated_event(priv, true); + mwifiex_hs_activated_event(adapter, true); return 0; } else { mwifiex_dbg(adapter, CMD, @@ -1217,11 +1215,11 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_privat= e *priv, if (conditions !=3D HS_CFG_CANCEL) { set_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); if (adapter->iface_type =3D=3D MWIFIEX_USB) - mwifiex_hs_activated_event(priv, true); + mwifiex_hs_activated_event(adapter, true); } else { clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); if (adapter->hs_activated) - mwifiex_hs_activated_event(priv, false); + mwifiex_hs_activated_event(adapter, false); } =20 return 0; @@ -1250,9 +1248,7 @@ mwifiex_process_hs_config(struct mwifiex_adapter *ada= pter) adapter->hs_activated =3D false; clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); clear_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags); - mwifiex_hs_activated_event(mwifiex_get_priv(adapter, - MWIFIEX_BSS_ROLE_ANY), - false); + mwifiex_hs_activated_event(adapter, false); } EXPORT_SYMBOL_GPL(mwifiex_process_hs_config); =20 @@ -1302,9 +1298,7 @@ mwifiex_process_sleep_confirm_resp(struct mwifiex_ada= pter *adapter, } adapter->pm_wakeup_card_req =3D true; if (test_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags)) - mwifiex_hs_activated_event(mwifiex_get_priv - (adapter, MWIFIEX_BSS_ROLE_ANY), - true); + mwifiex_hs_activated_event(adapter, true); adapter->ps_state =3D PS_STATE_SLEEP; cmd->command =3D cpu_to_le16(command); cmd->seq_num =3D cpu_to_le16(seq_num); diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wire= less/marvell/mwifiex/main.c index 0e1f539404014..8982017e871d4 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -415,10 +415,7 @@ int mwifiex_main_process(struct mwifiex_adapter *adapt= er) if (adapter->hs_activated) { clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); - mwifiex_hs_activated_event - (mwifiex_get_priv - (adapter, MWIFIEX_BSS_ROLE_ANY), - false); + mwifiex_hs_activated_event(adapter, false); } } =20 @@ -438,10 +435,7 @@ int mwifiex_main_process(struct mwifiex_adapter *adapt= er) if (adapter->hs_activated) { clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); - mwifiex_hs_activated_event - (mwifiex_get_priv - (adapter, MWIFIEX_BSS_ROLE_ANY), - false); + mwifiex_hs_activated_event(adapter, false); } } =20 @@ -460,10 +454,7 @@ int mwifiex_main_process(struct mwifiex_adapter *adapt= er) if (adapter->hs_activated) { clear_bit(MWIFIEX_IS_HS_CONFIGURED, &adapter->work_flags); - mwifiex_hs_activated_event - (mwifiex_get_priv - (adapter, MWIFIEX_BSS_ROLE_ANY), - false); + mwifiex_hs_activated_event(adapter, false); } } =20 diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wire= less/marvell/mwifiex/main.h index 63f1c900e0967..88bd21fd3c07f 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -1125,7 +1125,7 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private= *priv, struct host_cmd_ds_command *resp, struct mwifiex_ds_pm_cfg *pm_cfg); void mwifiex_process_hs_config(struct mwifiex_adapter *adapter); -void mwifiex_hs_activated_event(struct mwifiex_private *priv, +void mwifiex_hs_activated_event(struct mwifiex_adapter *adapter, u8 activated); int mwifiex_set_hs_params(struct mwifiex_private *priv, u16 action, int cmd_type, struct mwifiex_ds_hs_cfg *hs_cfg); --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14162280CF4 for ; Thu, 10 Apr 2025 10:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280700; cv=none; b=m/iO+AoTKkHZY8o1qRBUzhGOELml7PNU3q9PbK6A16fjvnpHChqqFOm9zLC4f7salor96i/S1LsYT0gvyGtpnsmdC7BQ/3IWe/ynW4dW/A9g934CKF7MBQl3IP13QucGwfZzCB8CMa+JFm67maEv+SOeteuEW1KRQQl/6D9FnvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280700; c=relaxed/simple; bh=Ab11XkYP7l2RY9CTzXZ7K6wUdJN9FcRnpf0wdbRd/Lo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LkTKlO5irkh1dmjNr1gUqya7OYRkjKPLLAChk5OHGyc2u+03GkrljIO0geCetyaZm4yMmnmir3VW5099QV1Wsv6mc40InN/PavVdCc+7IyX8ipIiXSyRqauAVF/c6G0VArTlXK+vHzyFoJecQONaaUls3eydEMKIDWWBPC/sH7w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DH-5i; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmw-2r; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2J; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:27 +0200 Subject: [PATCH wireless-next v6 3/9] wifi: mwifiex: drop unnecessary initialization Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-3-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=2071; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=Ab11XkYP7l2RY9CTzXZ7K6wUdJN9FcRnpf0wdbRd/Lo=; b=OClhyOO/WDA6Wvh4yNjDUyGVTsMh9WUsTjnL9xyMDa2aOwwLO+o926RHCeuD4ate7KDUCcwsJ 9NNshB5xM2ICihw96VJ//ZM5cfMkLUXGnMCrBNPVamElp3QCENniivs X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Several functions initialize the priv * without actually using the initialized value. Drop the initialization. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 6 ++---- drivers/net/wireless/marvell/mwifiex/txrx.c | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wi= reless/marvell/mwifiex/cmdevt.c index ee3ec80ae3a46..1c8d69190be65 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -472,8 +472,7 @@ void mwifiex_free_cmd_buffer(struct mwifiex_adapter *ad= apter) int mwifiex_process_event(struct mwifiex_adapter *adapter) { int ret, i; - struct mwifiex_private *priv =3D - mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); + struct mwifiex_private *priv; struct sk_buff *skb =3D adapter->event_skb; u32 eventcause; struct mwifiex_rxinfo *rx_info; @@ -808,8 +807,7 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapt= er) int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) { struct host_cmd_ds_command *resp; - struct mwifiex_private *priv =3D - mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); + struct mwifiex_private *priv; int ret =3D 0; uint16_t orig_cmdresp_no; uint16_t cmdresp_no; diff --git a/drivers/net/wireless/marvell/mwifiex/txrx.c b/drivers/net/wire= less/marvell/mwifiex/txrx.c index bd91678d26b49..f44e22f245110 100644 --- a/drivers/net/wireless/marvell/mwifiex/txrx.c +++ b/drivers/net/wireless/marvell/mwifiex/txrx.c @@ -24,8 +24,7 @@ int mwifiex_handle_rx_packet(struct mwifiex_adapter *adapter, struct sk_buff *skb) { - struct mwifiex_private *priv =3D - mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY); + struct mwifiex_private *priv; struct rxpd *local_rx_pd; struct mwifiex_rxinfo *rx_info =3D MWIFIEX_SKB_RXCB(skb); int ret; --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E68D4281358 for ; Thu, 10 Apr 2025 10:24:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280692; cv=none; b=daEjSlJNi0l5k1KXXfN+IsadUcQBPl3F8m/W8Lz6rHZnIAUJA8w+OyBXYJ2tPef3+tMqoVec6tfh6EIZs/AwYgV6d/867kCQGT0XTyWdwLZocklyh05zIxmNpZXuduRLBi3PQuPWFU64Bof37C6tlCktTzX3ln3HDTimmWBOHOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280692; c=relaxed/simple; bh=Ys2BPZTfw4wgHFHQdf+XixxFvf910g3Pa5v+0HhjRS4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MpQaTAQeGnK9e60md1QE7eRg1hyAayoiFPKILBtHBgFhKzT8cqDftFZhGDWJnugxjUjhNG1BEOO7DjcDmHgey3YEZODYlm9T2qcZYsX/vWEanT73yDFoW+HnmN9LptU8z0A7YNg/6ZFKkzYyo4VCPdTy6gTyrLuuDbDfsQGdqtk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DE-5j; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmx-2h; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2K; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:28 +0200 Subject: [PATCH wireless-next v6 4/9] wifi: mwifiex: make region_code_mapping_t const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-4-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=2653; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=Ys2BPZTfw4wgHFHQdf+XixxFvf910g3Pa5v+0HhjRS4=; b=9HE9kSWgICCfAnvAoyuB73ju3aXHd1XS3O4JyFqjhYxuANvTY7BPPtscmGhzWJJ/b6eRIt2iX gBI16V5n4XKDV+myWApK/UrdgLBL1xp8YQrMorM02IgktANvahVxfZw X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org region_code_mapping_t is not modified and shouldn't be. Mark it const. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 2 +- drivers/net/wireless/marvell/mwifiex/cfp.c | 4 ++-- drivers/net/wireless/marvell/mwifiex/main.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/= wireless/marvell/mwifiex/cfg80211.c index a099fdaafa45d..33bc5cd3ce960 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -4703,7 +4703,7 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter = *adapter) void *wdev_priv; struct wiphy *wiphy; struct mwifiex_private *priv =3D adapter->priv[MWIFIEX_BSS_TYPE_STA]; - u8 *country_code; + const u8 *country_code; u32 thr, retry; struct cfg80211_ops *ops; =20 diff --git a/drivers/net/wireless/marvell/mwifiex/cfp.c b/drivers/net/wirel= ess/marvell/mwifiex/cfp.c index d7fd79214bcfb..686bf12b6c26b 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfp.c +++ b/drivers/net/wireless/marvell/mwifiex/cfp.c @@ -153,7 +153,7 @@ struct region_code_mapping { u8 region[IEEE80211_COUNTRY_STRING_LEN] __nonstring; }; =20 -static struct region_code_mapping region_code_mapping_t[] =3D { +static const struct region_code_mapping region_code_mapping_t[] =3D { { 0x10, "US " }, /* US FCC */ { 0x20, "CA " }, /* IC Canada */ { 0x30, "FR " }, /* France */ @@ -165,7 +165,7 @@ static struct region_code_mapping region_code_mapping_t= [] =3D { }; =20 /* This function converts integer code to region string */ -u8 *mwifiex_11d_code_2_region(u8 code) +const u8 *mwifiex_11d_code_2_region(u8 code) { u8 i; =20 diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wire= less/marvell/mwifiex/main.h index 88bd21fd3c07f..3efdd53c4b59f 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -1565,7 +1565,7 @@ int mwifiex_add_wowlan_magic_pkt_filter(struct mwifie= x_adapter *adapter); int mwifiex_set_mgmt_ies(struct mwifiex_private *priv, struct cfg80211_beacon_data *data); int mwifiex_del_mgmt_ies(struct mwifiex_private *priv); -u8 *mwifiex_11d_code_2_region(u8 code); +const u8 *mwifiex_11d_code_2_region(u8 code); void mwifiex_uap_set_channel(struct mwifiex_private *priv, struct mwifiex_uap_bss_param *bss_cfg, struct cfg80211_chan_def chandef); --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ED17280CEE for ; Thu, 10 Apr 2025 10:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280709; cv=none; b=KT4fhymmKmhTEuLyCQLetx99htUp5W54a3bPRrZXaua0q1Ua3XgFFZxh0TjCaMVSniP1B4WSUQRFAl0+CexzFF4CiRv3Oni8Ugyvd11ZQ6THba+RWDew8Cfd6PELSbRQl/LLwlhqKWCZY+mmzhz5qkcUYoGCc29YnfwRf7hq66A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280709; c=relaxed/simple; bh=ielTtZR3xx01MBPj7eIJpEVIxa/elFoWROV7Rp6I9oA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UYe8R58An0vKYUVPbENWEuF+rC6aXhuKcko+GwIO4cX2QYKXulSK1qdcCzqEfU77EFM9ks8wJTpYgLsfY5nz7peldnQZrFRgy3jOI0Tu5WKE2qOKRAy3Ab/waFhnzOO0wGyq9JVna/aIkuyNp83Y553qCllSmtsU+2RFtUSNEGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DI-5h; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmy-2s; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2N; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:29 +0200 Subject: [PATCH wireless-next v6 5/9] wifi: mwifiex: pass adapter to mwifiex_dnld_cmd_to_fw() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-5-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=2163; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=ielTtZR3xx01MBPj7eIJpEVIxa/elFoWROV7Rp6I9oA=; b=nmxDcgu1pMnRAfCOP9FUa902cPZcpyGQeoMMr7Iz1BZ9NFTWOy4VCUwokyks5PtOTW5Lmxmf+ bfnngC8E+YGB7HHhyh/VE3C1rGN1LxMOuC28m1vZZnKXAAcoFZHNx2d X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org priv is not needed in mwifiex_dnld_cmd_to_fw(), so pass the adapter to it as context pointer. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wi= reless/marvell/mwifiex/cmdevt.c index 1c8d69190be65..1dca09646be27 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -159,11 +159,9 @@ static int mwifiex_cmd_host_cmd(struct mwifiex_private= *priv, * sending. Afterwards, it logs the command ID and action for debugging * and sets up the command timeout timer. */ -static int mwifiex_dnld_cmd_to_fw(struct mwifiex_private *priv, +static int mwifiex_dnld_cmd_to_fw(struct mwifiex_adapter *adapter, struct cmd_ctrl_node *cmd_node) { - - struct mwifiex_adapter *adapter =3D priv->adapter; int ret; struct host_cmd_ds_command *host_cmd; uint16_t cmd_code; @@ -742,7 +740,6 @@ mwifiex_insert_cmd_to_pending_q(struct mwifiex_adapter = *adapter, */ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapter) { - struct mwifiex_private *priv; struct cmd_ctrl_node *cmd_node; int ret =3D 0; struct host_cmd_ds_command *host_cmd; @@ -766,7 +763,6 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapt= er) struct cmd_ctrl_node, list); =20 host_cmd =3D (struct host_cmd_ds_command *) (cmd_node->cmd_skb->data); - priv =3D cmd_node->priv; =20 if (adapter->ps_state !=3D PS_STATE_AWAKE) { mwifiex_dbg(adapter, ERROR, @@ -781,7 +777,7 @@ int mwifiex_exec_next_cmd(struct mwifiex_adapter *adapt= er) spin_unlock_bh(&adapter->cmd_pending_q_lock); =20 spin_unlock_bh(&adapter->mwifiex_cmd_lock); - ret =3D mwifiex_dnld_cmd_to_fw(priv, cmd_node); + ret =3D mwifiex_dnld_cmd_to_fw(adapter, cmd_node); =20 /* Any command sent to the firmware when host is in sleep * mode should de-configure host sleep. We should skip the --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF56D284B5B for ; Thu, 10 Apr 2025 10:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280716; cv=none; b=uC+6KOtozZYy/GWW7F+BrE6pkV6KFUTXIlfFVSKnyrGkRVx6xt8dp3oZVGmtuuExqD83UJ+sOsl7uL/aun8rEsBf8QfdXLhAQyYRA7FRKrp2ObUzqIBKkHccs7EHanu8zcnhwgKbNLuwGaAJc0X11zi/eqBVq6JFSbyjvsM8Tqk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280716; c=relaxed/simple; bh=nt+RA2PEb1rBYOFg/KbiJGocixEt5bp9cJpa0Hka3K8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KFJR4hsPmk65Kt04bzi3U3FJfz9P7vvNPzPxlUlYc/DwPXYYsb7P1kMbHZq/T1DZJDPQDcWf6MAFEOuBy0BUnb/xNGjDxiAmW5z2wcSRDHQT3wKh8D2K6g84an2UWFdWtd5t4QQCzZZVpOsYFx8CkwEYFq+irFMRPzCLCSB+jEU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DG-5i; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fmz-2r; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2O; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:30 +0200 Subject: [PATCH wireless-next v6 6/9] wifi: mwifiex: simplify mwifiex_setup_ht_caps() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-6-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=2419; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=nt+RA2PEb1rBYOFg/KbiJGocixEt5bp9cJpa0Hka3K8=; b=PGGT8nVJMqbToJ/pQIyVmvysnIns+uBNtP3Xa3hbQHCTH7p3hp06BLob4oOS0PKhCcH9zx28K 5reydWOLU41DF12xz5n/pFI9qrXujO6rpkj5fQjJlPis2Tx5UftC8qJ X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org In mwifiex_setup_ht_caps() first a local struct ieee80211_mcs_info is initialized and afterwards copied over &ht_info->mcs. Simplify this by initializing &ht_info->mcs directly. While at it call memset on the u8 rx_mask[] array instead of the struct which makes the intention clearer and we no longer have to assume the rx_mask array is the first member of struct ieee80211_mcs_info. Signed-off-by: Sascha Hauer Acked-by: Brian Norris Reviewed-by: Jeff Chen --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/= wireless/marvell/mwifiex/cfg80211.c index 33bc5cd3ce960..1d9bc8f980c8d 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -2906,16 +2906,12 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *= ht_info, struct mwifiex_private *priv) { int rx_mcs_supp; - struct ieee80211_mcs_info mcs_set; - u8 *mcs =3D (u8 *)&mcs_set; struct mwifiex_adapter *adapter =3D priv->adapter; =20 ht_info->ht_supported =3D true; ht_info->ampdu_factor =3D IEEE80211_HT_MAX_AMPDU_64K; ht_info->ampdu_density =3D IEEE80211_HT_MPDU_DENSITY_NONE; =20 - memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); - /* Fill HT capability information */ if (ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap)) ht_info->cap |=3D IEEE80211_HT_CAP_SUP_WIDTH_20_40; @@ -2961,17 +2957,15 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap *= ht_info, ht_info->cap |=3D IEEE80211_HT_CAP_SM_PS; =20 rx_mcs_supp =3D GET_RXMCSSUPP(adapter->user_dev_mcs_support); + + memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); /* Set MCS for 1x1/2x2 */ - memset(mcs, 0xff, rx_mcs_supp); - /* Clear all the other values */ - memset(&mcs[rx_mcs_supp], 0, - sizeof(struct ieee80211_mcs_info) - rx_mcs_supp); + memset(ht_info->mcs.rx_mask, 0xff, rx_mcs_supp); + if (priv->bss_mode =3D=3D NL80211_IFTYPE_STATION || ISSUPP_CHANWIDTH40(adapter->hw_dot_11n_dev_cap)) /* Set MCS32 for infra mode or ad-hoc mode with 40MHz support */ - SETHT_MCS32(mcs_set.rx_mask); - - memcpy((u8 *) &ht_info->mcs, mcs, sizeof(struct ieee80211_mcs_info)); + SETHT_MCS32(ht_info->mcs.rx_mask); =20 ht_info->mcs.tx_params =3D IEEE80211_HT_MCS_TX_DEFINED; } --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EC48281355 for ; Thu, 10 Apr 2025 10:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280684; cv=none; b=pSdtoPCKLnduHvj8BoGOWRsRy7Gc6m7rYum/STlmoSENi9mDUtMIfj9EbjWmDUk3il7NIM8S5ojTViJZJ9WxLZ46Bqq9+FXlKkd55G/8aBbtmE48rdI2BlxSda+usMh5Hw8COCZUXG9z8D9BVZ9J+88RVX4++JLMls3zTrj7dPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280684; c=relaxed/simple; bh=OCfonBvKN0BbaLPnvNjIOOnkihYh96k9ma6b5AkPwR0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gH8egqv2zFWv0loIuTR2M1eZP9vpIunxfe/cyeSQC2+hL6HUwSi0UeJl44rfBQS9kcaJHwrqQbMHAGr8j+mbv1SQS/V9wyqMrvqZWJA1lAVrYGqoh1HNlq3ujtKlUPVpxHCngCp0pJrMS7hQSMbchUFlhz7w343moH61UsIDJyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DL-5h; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fn0-2s; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2P; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:31 +0200 Subject: [PATCH wireless-next v6 7/9] wifi: mwifiex: fix indention Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-7-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=1301; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=OCfonBvKN0BbaLPnvNjIOOnkihYh96k9ma6b5AkPwR0=; b=wEthxHJD3zHHExEO9voEBXwKpo3A1GxEEq6C693PH/DdJYP2ED08uwBVY10zU6Zl00BhwSqMK hiPZQ0ulCGiC2QWVjqEc5j0T8QoF3ngJAJQxLSzwx1L9YJPFAi4IgpW X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Align multiline if() under the opening brace. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/wmm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/wmm.c b/drivers/net/wirel= ess/marvell/mwifiex/wmm.c index bcb61dab7dc86..1b1222c73728f 100644 --- a/drivers/net/wireless/marvell/mwifiex/wmm.c +++ b/drivers/net/wireless/marvell/mwifiex/wmm.c @@ -1428,13 +1428,13 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *a= dapter) } =20 if (!ptr->is_11n_enabled || - ptr->ba_status || - priv->wps.session_enable) { + ptr->ba_status || + priv->wps.session_enable) { if (ptr->is_11n_enabled && - ptr->ba_status && - ptr->amsdu_in_ampdu && - mwifiex_is_amsdu_allowed(priv, tid) && - mwifiex_is_11n_aggragation_possible(priv, ptr, + ptr->ba_status && + ptr->amsdu_in_ampdu && + mwifiex_is_amsdu_allowed(priv, tid) && + mwifiex_is_11n_aggragation_possible(priv, ptr, adapter->tx_buf_size)) mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index); /* ra_list_spinlock has been freed in --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7672828135A for ; Thu, 10 Apr 2025 10:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; cv=none; b=AQmSioEsplhm1iarXo+GXCl65CbHPrNGHNOLMZsIv6M15x3uovKKM8b7XVdJ2vD9MSGJ2o2gPrTQ3EQduFivDWINyve/gR0wJXKVZPb7tQY10E7LF0o9t8LQOh5dLfF0/omQMNDShA9JIaAUVoDDvieE+qCvwLf++dTSfmNEqGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; c=relaxed/simple; bh=rMJbXWC+jDUOohOA/xD6FAvMOqOrfNDnQE4N55xs420=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ye7jMb9gdYiR/gh+QU65pL6wm8KhhM7lule9U3UsA94svwB4wpp0H5TQeazVyAQc1FUCbLO7zEeGOgn+wnCukDTMDxPH/8whOI33Q3jyoyuF3DoMbdgc3lEeFB0Iwjd9ytVE7SwWbwsmL1RIxqBZK9qQA7ESSkUVY5UVle1r2bQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DK-5i; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fn1-2r; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2Q; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:32 +0200 Subject: [PATCH wireless-next v6 8/9] wifi: mwifiex: make locally used function static Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-8-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer , Francesco Dolcini X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=1694; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=rMJbXWC+jDUOohOA/xD6FAvMOqOrfNDnQE4N55xs420=; b=TIMOuWgT9ecLw6MLv3Fyd+4aIjU5rwweCJ8xQrAwYmjmmHlPNc6P358GRES89oUBFIylM/HlB BEG20jcDc/1CMkmbdsXmwDc/IXoQX4uSTZnqunfu2MEYT/O2Piu4vcA X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org mwifiex_is_tdls_off_chan() is only used locally. Make it static. Reviewed-by: Francesco Dolcini Signed-off-by: Sascha Hauer Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/main.h | 1 - drivers/net/wireless/marvell/mwifiex/util.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.h b/drivers/net/wire= less/marvell/mwifiex/main.h index 3efdd53c4b59f..e566470226d8f 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h @@ -1598,7 +1598,6 @@ mwifiex_add_sta_entry(struct mwifiex_private *priv, c= onst u8 *mac); struct mwifiex_sta_node * mwifiex_get_sta_entry(struct mwifiex_private *priv, const u8 *mac); u8 mwifiex_is_tdls_chan_switching(struct mwifiex_private *priv); -u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv); u8 mwifiex_is_send_cmd_allowed(struct mwifiex_private *priv); int mwifiex_send_tdls_data_frame(struct mwifiex_private *priv, const u8 *p= eer, u8 action_code, u8 dialog_token, diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wire= less/marvell/mwifiex/util.c index 1f1f6280a0f25..ea28d604ee69c 100644 --- a/drivers/net/wireless/marvell/mwifiex/util.c +++ b/drivers/net/wireless/marvell/mwifiex/util.c @@ -663,7 +663,7 @@ u8 mwifiex_is_tdls_chan_switching(struct mwifiex_privat= e *priv) return false; } =20 -u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv) +static u8 mwifiex_is_tdls_off_chan(struct mwifiex_private *priv) { struct mwifiex_sta_node *sta_ptr; =20 --=20 2.39.5 From nobody Wed Dec 17 10:21:45 2025 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76693281359 for ; Thu, 10 Apr 2025 10:24:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; cv=none; b=rne3P0tkN5sM1leaM8d6Iv6Hedg+NvMh/TvaS4EXjJHnYe6WmKpGuJleSxF2/kiQmGciXFXeWHGx0rN9GCzIoiurD6lkRo6Jhd/E7jvyBF4pVJ1JDvPQS64nHiMZ6YWoJZy8h/Q+L3K6Hv7C4mXC8wqm/pDEI9He8TnRcerFgDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744280685; c=relaxed/simple; bh=5KbUjdnS2aAFU8RuRz4T2Qr5Fc8KYXahzn80h5q/0xs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T8hOeW6DLnlG1p4b4MvLecUUE2ZqodJBsvHf9gRiMStb1137c5SHJxlpl29m7SMYpF7dXb2eAxh6YZJiqAfmGrvgaGYInDLTmukc+3w2YmurvqBf4vNAFhZ9pRiPcmid1SEqExLGY8uWQlhkSfsMQT921WVofmwXBisJF5Qi5V4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u2p5C-0002DJ-5i; Thu, 10 Apr 2025 12:24:30 +0200 Received: from dude02.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::28]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u2p5A-004Fn2-2q; Thu, 10 Apr 2025 12:24:28 +0200 Received: from localhost ([::1] helo=dude02.red.stw.pengutronix.de) by dude02.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1u2p5A-002ODU-2R; Thu, 10 Apr 2025 12:24:28 +0200 From: Sascha Hauer Date: Thu, 10 Apr 2025 12:24:33 +0200 Subject: [PATCH wireless-next v6 9/9] wifi: mwifiex: move common settings out of switch/case Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250410-mwifiex-cleanup-1-v6-9-a6bbd4ac4d37@pengutronix.de> References: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> In-Reply-To: <20250410-mwifiex-cleanup-1-v6-0-a6bbd4ac4d37@pengutronix.de> To: Brian Norris , Francesco Dolcini Cc: Johannes Berg , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, David Lin , kernel@pengutronix.de, Sascha Hauer X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1744280668; l=3023; i=s.hauer@pengutronix.de; s=20230412; h=from:subject:message-id; bh=5KbUjdnS2aAFU8RuRz4T2Qr5Fc8KYXahzn80h5q/0xs=; b=dqBbjz67T45R6mTygkqn6N5S530t1gHpAyohVWkutSaUqP5ew4HXtnG2cKTVlcQwmAWE055qs ZpJSseqWjEhA0LqzrJTXB2o4X4yF9T3e71satyFv6aV25FjYhsLohvR X-Developer-Key: i=s.hauer@pengutronix.de; a=ed25519; pk=4kuc9ocmECiBJKWxYgqyhtZOHj5AWi7+d0n/UjhkwTg= X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: s.hauer@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org In mwifiex_add_virtual_intf() several settings done in a switch/case are the same in all cases. Move them out of the switch/case to deduplicate the code. bss_started is not initialized in all switch/case branches, but it is only used in AP mode in the driver, so it doesn't hurt to move its initialization out of the switch/case as well. Signed-off-by: Sascha Hauer Reviewed-by: Francesco Dolcini Acked-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/= wireless/marvell/mwifiex/cfg80211.c index 1d9bc8f980c8d..5d6f4d2922b64 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -3007,7 +3007,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct = wiphy *wiphy, return ERR_PTR(-EFAULT); } =20 - priv->wdev.wiphy =3D wiphy; priv->wdev.iftype =3D NL80211_IFTYPE_STATION; =20 if (type =3D=3D NL80211_IFTYPE_UNSPECIFIED) @@ -3016,8 +3015,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct = wiphy *wiphy, priv->bss_mode =3D type; =20 priv->bss_type =3D MWIFIEX_BSS_TYPE_STA; - priv->frame_type =3D MWIFIEX_DATA_FRAME_TYPE_ETH_II; - priv->bss_priority =3D 0; priv->bss_role =3D MWIFIEX_BSS_ROLE_STA; =20 break; @@ -3037,14 +3034,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struc= t wiphy *wiphy, return ERR_PTR(-EFAULT); } =20 - priv->wdev.wiphy =3D wiphy; priv->wdev.iftype =3D NL80211_IFTYPE_AP; =20 priv->bss_type =3D MWIFIEX_BSS_TYPE_UAP; - priv->frame_type =3D MWIFIEX_DATA_FRAME_TYPE_ETH_II; - priv->bss_priority =3D 0; priv->bss_role =3D MWIFIEX_BSS_ROLE_UAP; - priv->bss_started =3D 0; priv->bss_mode =3D type; =20 break; @@ -3064,7 +3057,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct = wiphy *wiphy, return ERR_PTR(-EFAULT); } =20 - priv->wdev.wiphy =3D wiphy; /* At start-up, wpa_supplicant tries to change the interface * to NL80211_IFTYPE_STATION if it is not managed mode. */ @@ -3077,10 +3069,7 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct= wiphy *wiphy, */ priv->bss_type =3D MWIFIEX_BSS_TYPE_P2P; =20 - priv->frame_type =3D MWIFIEX_DATA_FRAME_TYPE_ETH_II; - priv->bss_priority =3D 0; priv->bss_role =3D MWIFIEX_BSS_ROLE_STA; - priv->bss_started =3D 0; =20 if (mwifiex_cfg80211_init_p2p_client(priv)) { memset(&priv->wdev, 0, sizeof(priv->wdev)); @@ -3094,6 +3083,11 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct= wiphy *wiphy, return ERR_PTR(-EINVAL); } =20 + priv->wdev.wiphy =3D wiphy; + priv->bss_priority =3D 0; + priv->bss_started =3D 0; + priv->frame_type =3D MWIFIEX_DATA_FRAME_TYPE_ETH_II; + dev =3D alloc_netdev_mqs(sizeof(struct mwifiex_private *), name, name_assign_type, ether_setup, IEEE80211_NUM_ACS, 1); --=20 2.39.5