dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nouveau/vmm: use kzalloc_flex
@ 2026-03-12 19:55 Rosen Penev
  2026-05-08 18:29 ` lyude
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-03-12 19:55 UTC (permalink / raw)
  To: dri-devel
  Cc: Lyude Paul, Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, open list

Use the proper macro do to these sizeof calculations.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
index 958fd78080bd..b9648290dffb 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
@@ -53,7 +53,7 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc, bool sparse,
 		}
 	}
 
-	if (!(pgt = kzalloc(sizeof(*pgt) + (sizeof(pgt->pte[0]) * lpte), GFP_KERNEL)))
+	if (!(pgt = kzalloc_flex(*pgt, pte, lpte)))
 		return NULL;
 	pgt->page = page ? page->shift : 0;
 	pgt->sparse = sparse;
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nouveau/vmm: use kzalloc_flex
  2026-03-12 19:55 [PATCH] nouveau/vmm: use kzalloc_flex Rosen Penev
@ 2026-05-08 18:29 ` lyude
  0 siblings, 0 replies; 2+ messages in thread
From: lyude @ 2026-05-08 18:29 UTC (permalink / raw)
  To: Rosen Penev, dri-devel
  Cc: Danilo Krummrich, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, open list

Sorry I didn't notice this patch until now!

Reviewed-by: Lyude Paul <lyude@redhat.com>

Will push it to drm-misc-next in just a moment

On Thu, 2026-03-12 at 12:55 -0700, Rosen Penev wrote:
> Use the proper macro do to these sizeof calculations.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
> index 958fd78080bd..b9648290dffb 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c
> @@ -53,7 +53,7 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc,
> bool sparse,
>  		}
>  	}
>  
> -	if (!(pgt = kzalloc(sizeof(*pgt) + (sizeof(pgt->pte[0]) *
> lpte), GFP_KERNEL)))
> +	if (!(pgt = kzalloc_flex(*pgt, pte, lpte)))
>  		return NULL;
>  	pgt->page = page ? page->shift : 0;
>  	pgt->sparse = sparse;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-08 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 19:55 [PATCH] nouveau/vmm: use kzalloc_flex Rosen Penev
2026-05-08 18:29 ` lyude

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox