linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] wifi: brcmfmac: Make read-only array cfg_offset static const
@ 2025-06-19  8:25 Colin Ian King
  2025-06-19 14:49 ` Arend Van Spriel
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2025-06-19  8:25 UTC (permalink / raw)
  To: Arend van Spriel, Kalle Valo, linux-wireless, brcm80211,
	brcm80211-dev-list.pdl
  Cc: kernel-janitors, linux-kernel

Don't populate the read-only array cfg_offset on the stack at run time,
instead make it static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 .../broadcom/brcm80211/brcmfmac/pcie.c        | 24 ++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
index 8f97562811d7..9747928a3650 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
@@ -654,17 +654,19 @@ brcmf_pcie_select_core(struct brcmf_pciedev_info *devinfo, u16 coreid)
 static void brcmf_pcie_reset_device(struct brcmf_pciedev_info *devinfo)
 {
 	struct brcmf_core *core;
-	u16 cfg_offset[] = { BRCMF_PCIE_CFGREG_STATUS_CMD,
-			     BRCMF_PCIE_CFGREG_PM_CSR,
-			     BRCMF_PCIE_CFGREG_MSI_CAP,
-			     BRCMF_PCIE_CFGREG_MSI_ADDR_L,
-			     BRCMF_PCIE_CFGREG_MSI_ADDR_H,
-			     BRCMF_PCIE_CFGREG_MSI_DATA,
-			     BRCMF_PCIE_CFGREG_LINK_STATUS_CTRL2,
-			     BRCMF_PCIE_CFGREG_RBAR_CTRL,
-			     BRCMF_PCIE_CFGREG_PML1_SUB_CTRL1,
-			     BRCMF_PCIE_CFGREG_REG_BAR2_CONFIG,
-			     BRCMF_PCIE_CFGREG_REG_BAR3_CONFIG };
+	static const u16 cfg_offset[] = {
+		BRCMF_PCIE_CFGREG_STATUS_CMD,
+		BRCMF_PCIE_CFGREG_PM_CSR,
+		BRCMF_PCIE_CFGREG_MSI_CAP,
+		BRCMF_PCIE_CFGREG_MSI_ADDR_L,
+		BRCMF_PCIE_CFGREG_MSI_ADDR_H,
+		BRCMF_PCIE_CFGREG_MSI_DATA,
+		BRCMF_PCIE_CFGREG_LINK_STATUS_CTRL2,
+		BRCMF_PCIE_CFGREG_RBAR_CTRL,
+		BRCMF_PCIE_CFGREG_PML1_SUB_CTRL1,
+		BRCMF_PCIE_CFGREG_REG_BAR2_CONFIG,
+		BRCMF_PCIE_CFGREG_REG_BAR3_CONFIG
+	};
 	u32 i;
 	u32 val;
 	u32 lsc;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] wifi: brcmfmac: Make read-only array cfg_offset static const
  2025-06-19  8:25 [PATCH][next] wifi: brcmfmac: Make read-only array cfg_offset static const Colin Ian King
@ 2025-06-19 14:49 ` Arend Van Spriel
  0 siblings, 0 replies; 2+ messages in thread
From: Arend Van Spriel @ 2025-06-19 14:49 UTC (permalink / raw)
  To: Colin Ian King, Kalle Valo, linux-wireless, brcm80211,
	brcm80211-dev-list.pdl
  Cc: kernel-janitors, linux-kernel

On June 19, 2025 10:26:15 AM Colin Ian King <colin.i.king@gmail.com> wrote:

> Don't populate the read-only array cfg_offset on the stack at run time,
> instead make it static const.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>

> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> .../broadcom/brcm80211/brcmfmac/pcie.c        | 24 ++++++++++---------
> 1 file changed, 13 insertions(+), 11 deletions(-)



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-19 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19  8:25 [PATCH][next] wifi: brcmfmac: Make read-only array cfg_offset static const Colin Ian King
2025-06-19 14:49 ` Arend Van Spriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).