* [PATCH] drm/amdgpu: use kvcalloc for entry->entries.
@ 2021-06-25 2:33 huqiqiao
0 siblings, 0 replies; 3+ messages in thread
From: huqiqiao @ 2021-06-25 2:33 UTC (permalink / raw)
To: alexander.deucher, christian.koenig; +Cc: dri-devel, linux-kernel, huqiqiao
kmalloc_array + __GFP_ZERO is the same with kvcalloc.
Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9acee4a5b2ba..5a012321d09e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -909,8 +909,7 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
num_entries = amdgpu_vm_num_entries(adev, cursor->level);
entry->entries = kvmalloc_array(num_entries,
- sizeof(*entry->entries),
- GFP_KERNEL | __GFP_ZERO);
+ sizeof(*entry->entries), GFP_KERNEL);
if (!entry->entries)
return -ENOMEM;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/amdgpu: use kvcalloc for entry->entries
2021-06-25 2:03 huqiqiao
@ 2021-06-28 15:00 ` Christian König
0 siblings, 0 replies; 3+ messages in thread
From: Christian König @ 2021-06-28 15:00 UTC (permalink / raw)
To: huqiqiao, alexander.deucher; +Cc: dri-devel, linux-kernel
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;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] drm/amdgpu: use kvcalloc for entry->entries
@ 2021-06-25 2:03 huqiqiao
2021-06-28 15:00 ` Christian König
0 siblings, 1 reply; 3+ messages in thread
From: huqiqiao @ 2021-06-25 2:03 UTC (permalink / raw)
To: alexander.deucher, christian.koenig; +Cc: dri-devel, linux-kernel, 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);
if (!entry->entries)
return -ENOMEM;
}
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-28 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-25 2:33 [PATCH] drm/amdgpu: use kvcalloc for entry->entries huqiqiao
-- strict thread matches above, loose matches on Subject: below --
2021-06-25 2:03 huqiqiao
2021-06-28 15:00 ` Christian König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).