Re: [PATCH][next] drm/i915/display: make read-only array rates static const

Jani Nikula <[email protected]> Thu, 18 Jun 2026 14:10:22 +0300
Newsgroups gmane.comp.freedesktop.xorg.drivers.intel,gmane.comp.video.dri.devel,gmane.linux.kernel.janitors,gmane.linux.kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland
Message-ID <[email protected]>
On Mon, 08 Jun 2026, Colin Ian King <[email protected]> wrote:
> Don't populate the read-only array rates the stack at run time,
> instead make it static const.
>
> Signed-off-by: Colin Ian King <[email protected]>

Thanks for the patch, pushed to drm-intel-next.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index 9076c2b176ec..351a62654a8d 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -71,7 +71,7 @@
>  
>  bool intel_hdmi_is_frl(u32 clock)
>  {
> -	u32 rates[] = { 300000, 600000, 800000, 1000000, 1200000 };
> +	static const u32 rates[] = { 300000, 600000, 800000, 1000000, 1200000 };
>  	int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(rates); i++)

-- 
Jani Nikula, Intel