From: lyude@redhat.com
To: Rosen Penev <rosenp@gmail.com>, nouveau@lists.freedesktop.org
Cc: Danilo Krummrich <dakr@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
"open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS"
<dri-devel@lists.freedesktop.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/nouveau/gsp: Use kzalloc_flex() for r535 display funcs
Date: Fri, 08 May 2026 14:54:01 -0400 [thread overview]
Message-ID: <e76465b097afa44f472294b0fdf775b7abd7da95.camel@redhat.com> (raw)
In-Reply-To: <20260508052056.1744665-1-rosenp@gmail.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
There's one change to make below, but I will just handle it locally
before pushing:
On Thu, 2026-05-07 at 22:20 -0700, Rosen Penev wrote:
> struct nvkm_disp_func ends with the user flexible array member.
> Allocate the
> r535 display function table with kzalloc_flex() instead of open-
> coding the
> size calculation with sizeof().
>
> This makes the allocation describe the object being allocated
> directly and
> keeps the fixed six user entries unchanged.
>
I assume this was the AI talking, but this sentence seems like a
nothing-burger. Will just drop it from the commit.
> Assisted-by: Codex:GPT-5.5
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> index 6e63df816d85..1155f079b0c3 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/disp.c
> @@ -1734,7 +1734,8 @@ r535_disp_new(const struct nvkm_disp_func *hw,
> struct nvkm_device *device,
> struct nvkm_disp_func *rm;
> int ret;
>
> - if (!(rm = kzalloc(sizeof(*rm) + 6 * sizeof(rm->user[0]),
> GFP_KERNEL)))
> + rm = kzalloc_flex(*rm, user, 6);
> + if (!rm)
> return -ENOMEM;
>
> rm->dtor = r535_disp_dtor;
prev parent reply other threads:[~2026-05-08 18:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 5:20 [PATCH] drm/nouveau/gsp: Use kzalloc_flex() for r535 display funcs Rosen Penev
2026-05-08 18:54 ` lyude [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=e76465b097afa44f472294b0fdf775b7abd7da95.camel@redhat.com \
--to=lyude@redhat.com \
--cc=airlied@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=rosenp@gmail.com \
--cc=simona@ffwll.ch \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox