nouveau/vmm: use kzalloc_flex
Subsystems (3)
PATCH 1/1 nouveau/vmm: use kzalloc_flex
Use the proper macro do to these sizeof calculations.
Signed-off-by Rosen Penev <[email protected]>
--- drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +1 -1
@@ -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;
Signature · 1 line
2.53.0
Sorry I didn't notice this patch until now!
Reviewed-by Lyude Paul <[email protected]>
Will push it to drm-misc-next in just a moment
Quoted 23 lines · Rosen Penev
Use the proper macro do to these sizeof calculations.
Signed-off-by Rosen Penev <[email protected]>---
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +0
-0@@ -53,7 +53,7 @@ nvkm_vmm_pt_new(const struct nvkm_vmm_desc *desc, bool sparse, } }drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +0
-1- if (!(pgt = kzalloc(sizeof(*pgt) + (sizeof(pgt->pte[0]) *lpte),
GFP_KERNEL)))drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +1
-0+if (!(pgt =kzalloc_flex (*pgt, pte, lpte)))return NULL;
pgt->page= page ?page->shift: 0;
pgt->sparse= sparse;