drm/amdgpu: use kvcalloc for entry->entries
Subsystems (2)
PATCH 1/1 drm/amdgpu: use kvcalloc for entry->entries
malloc_array + __GFP_ZERO is the same with kvcalloc.
Signed-off-by huqiqiao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1 -1
@@ -909,7 +909,7 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, num_entries =amdgpu_vm_num_entries (adev, cursor->level); entry->entries =kvcalloc (num_entries, -sizeof (*entry->entries),GFP_KERNEL ); +sizeof (*entry->entries),GFP_KERNEL );if (!entry->entries)return -ENOMEM ; }
Signature · 1 line
2.11.0
Christian König
maintainerAm 25.06.21 um 04:03 schrieb huqiqiao:
Quoted 12 lines
malloc_array+__GFP_ZEROis the same with kvcalloc.Signed-off-by huqiqiao <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, · line 912
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +1
-1@@ -909,7 +909,7 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev, num_entries =amdgpu_vm_num_entries (adev, cursor->level); entry->entries =kvcalloc (num_entries, -sizeof (*entry->entries),GFP_KERNEL ); +sizeof (*entry->entries),GFP_KERNEL );
All you seem to do here is to mess up the indentation?
Christian.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0if (!entry->entries)return -ENOMEM ; }