lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ttusro21.fsf@intel.com>
Date:   Wed, 28 Jun 2023 11:25:26 +0300
From:   Jani Nikula <jani.nikula@...ux.intel.com>
To:     Colin Ian King <colin.i.king@...il.com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] drm/edid: make read-only const array static

On Tue, 27 Jun 2023, Colin Ian King <colin.i.king@...il.com> wrote:
> Don't populate the const array on the stack, instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>

Thanks, pushed to drm-misc-next.

> ---
>  drivers/gpu/drm/drm_edid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index e0dbd9140726..39b13417b749 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3962,7 +3962,7 @@ static int drm_cvt_modes(struct drm_connector *connector,
>  	struct drm_display_mode *newmode;
>  	struct drm_device *dev = connector->dev;
>  	const struct cvt_timing *cvt;
> -	const int rates[] = { 60, 85, 75, 60, 50 };
> +	static const int rates[] = { 60, 85, 75, 60, 50 };
>  	const u8 empty[3] = { 0, 0, 0 };

Side note, this could be removed by replacing

	if (!memcmp(cvt->code, empty, 3))

with

	if (!memchr_inv(cvt->code, 0, 3))

or even

	if (!cvt->code[0] && !cvt->code[1] && !cvt->code[2])

BR,
Jani.

>  
>  	for (i = 0; i < 4; i++) {

-- 
Jani Nikula, Intel Open Source Graphics Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ