From: Srinivasan Shanmugam Date: Wed, 20 Dec 2023 14:06:20 +0000 (+0530) Subject: drm/amdgpu: Use kvcalloc instead of kvmalloc_array in amdgpu_cs_parser_bos() X-Git-Tag: v6.8-rc1~111^2~1^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b57e3ca1fb192962f5b062c2e13e1bab1936292c;p=thirdparty%2Fkernel%2Flinux.git drm/amdgpu: Use kvcalloc instead of kvmalloc_array in amdgpu_cs_parser_bos() kvmalloc_array + __GFP_ZERO is the same with kvcalloc. Fixes the below: drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c:873 amdgpu_cs_parser_bos() warn: Please consider using kvcalloc instead of kvmalloc_array Cc: Christian König Cc: Alex Deucher Signed-off-by: Srinivasan Shanmugam Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index e50be65000303..83c7fc09218c1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -870,9 +870,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p, struct amdgpu_bo *bo = e->bo; int i; - e->user_pages = kvmalloc_array(bo->tbo.ttm->num_pages, - sizeof(struct page *), - GFP_KERNEL | __GFP_ZERO); + e->user_pages = kvcalloc(bo->tbo.ttm->num_pages, + sizeof(struct page *), + GFP_KERNEL); if (!e->user_pages) { DRM_ERROR("kvmalloc_array failure\n"); r = -ENOMEM;