Skip to contentSkip to conversation

perf: imx9_perf: make the read-only array mask static const

PATCH Applied Colin Ian King 3 participants 3 messages Jun 11, 2025 – Jul 4, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: imx9_perf: make the read-only array mask static const

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

---
 drivers/perf/fsl_imx9_ddr_perf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/perf/fsl_imx9_ddr_perf.c +5 -3
index 843f163e6c33..267754fdf581 100644
@@ -461,9 +461,11 @@ static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int event,
 					  int counter, int axi_id, int axi_mask)
 {
 	u32 pmcfg1, pmcfg2;
-	u32 mask[] = {  MX93_PMCFG1_RD_TRANS_FILT_EN,
-			MX93_PMCFG1_WR_TRANS_FILT_EN,
-			MX93_PMCFG1_RD_BT_FILT_EN };
+	static const u32 mask[] = {
+		MX93_PMCFG1_RD_TRANS_FILT_EN,
+		MX93_PMCFG1_WR_TRANS_FILT_EN,
+		MX93_PMCFG1_RD_BT_FILT_EN
+	};
 
 	pmcfg1 = readl_relaxed(pmu->base + PMCFG1);
 
Signature · 1 line
2.49.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Colin Ian King

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

Quoted 26 lines
---
 drivers/perf/fsl_imx9_ddr_perf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/perf/fsl_imx9_ddr_perf.c +5 -4
index 843f163e6c33..267754fdf581 100644
@@ -461,9 +461,11 @@ static void imx93_ddr_perf_monitor_config(struct ddr_pmu *pmu, int event,
 					  int counter, int axi_id, int axi_mask)
 {
 	u32 pmcfg1, pmcfg2;
-	u32 mask[] = {  MX93_PMCFG1_RD_TRANS_FILT_EN,
-			MX93_PMCFG1_WR_TRANS_FILT_EN,
-			MX93_PMCFG1_RD_BT_FILT_EN };
+	static const u32 mask[] = {
+		MX93_PMCFG1_RD_TRANS_FILT_EN,
+		MX93_PMCFG1_WR_TRANS_FILT_EN,
+		MX93_PMCFG1_RD_BT_FILT_EN
+	};
 
 	pmcfg1 = readl_relaxed(pmu->base + PMCFG1);
 
--

2.49.0

maintainer Applied
#2 lore raw
In reply to Colin Ian King
Quoted 4 lines · Colin Ian King

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

Applied to will (for-next/perf), thanks!

[1/1] perf: imx9_perf: make the read-only array mask static const

      https://git.kernel.org/will/c/b6e37b27bf68

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev