diff mbox series

drm/amdgpu: use kvcalloc for entry->entries

Message ID 20210625020344.30979-1-huqiqiao@uniontech.com (mailing list archive)
State New, archived
Headers show
Series drm/amdgpu: use kvcalloc for entry->entries | expand

Commit Message

huqiqiao June 25, 2021, 2:03 a.m. UTC
malloc_array + __GFP_ZERO is the same with kvcalloc.

Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christian König June 28, 2021, 3 p.m. UTC | #1
Am 25.06.21 um 04:03 schrieb huqiqiao:
> malloc_array + __GFP_ZERO is the same with kvcalloc.
>
> Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index b8c31e3469c0..5cadfadc625f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -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.

>   		if (!entry->entries)
>   			return -ENOMEM;
>   	}
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index b8c31e3469c0..5cadfadc625f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -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;
 	}