From: Jani Nikula <jani.nikula@linux.intel.com>
To: Colin Ian King <colin.i.king@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drm/edid: make read-only const array static
Date: Wed, 28 Jun 2023 11:25:26 +0300 [thread overview]
Message-ID: <87ttusro21.fsf@intel.com> (raw)
In-Reply-To: <20230627170109.751829-1-colin.i.king@gmail.com>
On Tue, 27 Jun 2023, Colin Ian King <colin.i.king@gmail.com> wrote:
> Don't populate the const array on the stack, instead make it static.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.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
prev parent reply other threads:[~2023-06-28 8:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 17:01 [PATCH][next] drm/edid: make read-only const array static Colin Ian King
2023-06-28 8:25 ` Jani Nikula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ttusro21.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=airlied@gmail.com \
--cc=colin.i.king@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.