linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] perf: imx9_perf: make the read-only array mask static const
@ 2025-06-11 13:39 Colin Ian King
  2025-06-11 15:25 ` Frank Li
  2025-07-04 17:44 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Colin Ian King @ 2025-06-11 13:39 UTC (permalink / raw)
  To: Will Deacon, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel,
	linux-perf-users, imx
  Cc: kernel-janitors, linux-kernel

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

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/perf/fsl_imx9_ddr_perf.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c
index 843f163e6c33..267754fdf581 100644
--- a/drivers/perf/fsl_imx9_ddr_perf.c
+++ b/drivers/perf/fsl_imx9_ddr_perf.c
@@ -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


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

* Re: [PATCH][next] perf: imx9_perf: make the read-only array mask static const
  2025-06-11 13:39 [PATCH][next] perf: imx9_perf: make the read-only array mask static const Colin Ian King
@ 2025-06-11 15:25 ` Frank Li
  2025-07-04 17:44 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2025-06-11 15:25 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Will Deacon, Mark Rutland, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, linux-arm-kernel,
	linux-perf-users, imx, kernel-janitors, linux-kernel

On Wed, Jun 11, 2025 at 02:39:17PM +0100, Colin Ian King wrote:
> Don't populate the read-only array mask on the stack at run time,
> instead make it static const.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> ---
>  drivers/perf/fsl_imx9_ddr_perf.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c
> index 843f163e6c33..267754fdf581 100644
> --- a/drivers/perf/fsl_imx9_ddr_perf.c
> +++ b/drivers/perf/fsl_imx9_ddr_perf.c
> @@ -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
>

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

* Re: [PATCH][next] perf: imx9_perf: make the read-only array mask static const
  2025-06-11 13:39 [PATCH][next] perf: imx9_perf: make the read-only array mask static const Colin Ian King
  2025-06-11 15:25 ` Frank Li
@ 2025-07-04 17:44 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2025-07-04 17:44 UTC (permalink / raw)
  To: Mark Rutland, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, linux-arm-kernel, linux-perf-users, imx,
	Colin Ian King
  Cc: catalin.marinas, kernel-team, Will Deacon, kernel-janitors,
	linux-kernel

On Wed, 11 Jun 2025 14:39:17 +0100, Colin Ian King wrote:
> 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,
-- 
Will

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

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

end of thread, other threads:[~2025-07-04 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 13:39 [PATCH][next] perf: imx9_perf: make the read-only array mask static const Colin Ian King
2025-06-11 15:25 ` Frank Li
2025-07-04 17:44 ` Will Deacon

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).