Re: [PATCH] drm/modes: Make the whitelist more const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 06 Sep 2019, Maxime Ripard <mripard@xxxxxxxxxx> wrote:
> The commit 3764137906a5 ("drm/modes: Introduce a whitelist for the named
> modes") introduced a whitelist in the named modes lookup code in order to
> be a bit more robust.
>
> However, even though the char pointers were made const, the data they were
> pointing were not. Let's fix that.

Or rather, the char pointers were const, and they pointed at const
string literals, but the array of pointers itself was not const.

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>

> Fixes: 3764137906a5 ("drm/modes: Introduce a whitelist for the named modes")
> Suggested-by: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/drm_modes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index 858c67281518..88232698d7a0 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -1677,7 +1677,7 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
>  	return 0;
>  }
>  
> -static const char *drm_named_modes_whitelist[] = {
> +static const char * const drm_named_modes_whitelist[] = {
>  	"NTSC",
>  	"PAL",
>  };

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux