All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-23  9:12 ` huqiqiao
  0 siblings, 0 replies; 8+ messages in thread
From: huqiqiao @ 2021-06-23  9:12 UTC (permalink / raw)
  To: airlied, daniel; +Cc: amd-gfx, dri-devel, linux-kernel, huqiqiao

kvmalloc_array + __GFP_ZERO is the same with kvcalloc.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9acee4a5b2ba..50edc73525b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
 		unsigned num_entries;
 
 		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
-		entry->entries = kvmalloc_array(num_entries,
-						sizeof(*entry->entries),
-						GFP_KERNEL | __GFP_ZERO);
+		entry->entries = kvcalloc(num_entries,
+						sizeof(*entry->entries), GFP_KERNEL);
 		if (!entry->entries)
 			return -ENOMEM;
 	}
-- 
2.11.0




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-23  9:12 ` huqiqiao
  0 siblings, 0 replies; 8+ messages in thread
From: huqiqiao @ 2021-06-23  9:12 UTC (permalink / raw)
  To: airlied, daniel; +Cc: huqiqiao, dri-devel, amd-gfx, linux-kernel

kvmalloc_array + __GFP_ZERO is the same with kvcalloc.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9acee4a5b2ba..50edc73525b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
 		unsigned num_entries;
 
 		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
-		entry->entries = kvmalloc_array(num_entries,
-						sizeof(*entry->entries),
-						GFP_KERNEL | __GFP_ZERO);
+		entry->entries = kvcalloc(num_entries,
+						sizeof(*entry->entries), GFP_KERNEL);
 		if (!entry->entries)
 			return -ENOMEM;
 	}
-- 
2.11.0




^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-23  9:12 ` huqiqiao
  0 siblings, 0 replies; 8+ messages in thread
From: huqiqiao @ 2021-06-23  9:12 UTC (permalink / raw)
  To: airlied, daniel; +Cc: huqiqiao, dri-devel, amd-gfx, linux-kernel

kvmalloc_array + __GFP_ZERO is the same with kvcalloc.

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 9acee4a5b2ba..50edc73525b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
 		unsigned num_entries;
 
 		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
-		entry->entries = kvmalloc_array(num_entries,
-						sizeof(*entry->entries),
-						GFP_KERNEL | __GFP_ZERO);
+		entry->entries = kvcalloc(num_entries,
+						sizeof(*entry->entries), GFP_KERNEL);
 		if (!entry->entries)
 			return -ENOMEM;
 	}
-- 
2.11.0



_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
  2021-06-23  9:12 ` huqiqiao
  (?)
@ 2021-06-24 13:14   ` Christian König
  -1 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2021-06-24 13:14 UTC (permalink / raw)
  To: huqiqiao, airlied, daniel; +Cc: dri-devel, amd-gfx, linux-kernel



Am 23.06.21 um 11:12 schrieb huqiqiao:
> kvmalloc_array + __GFP_ZERO is the same with kvcalloc.
>
> Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9acee4a5b2ba..50edc73525b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
>   		unsigned num_entries;
>   
>   		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
> -		entry->entries = kvmalloc_array(num_entries,
> -						sizeof(*entry->entries),
> -						GFP_KERNEL | __GFP_ZERO);
> +		entry->entries = kvcalloc(num_entries,
> +						sizeof(*entry->entries), GFP_KERNEL);

Sounds like a good idea in general, but the indentation on the second 
line seems to be of.

Christian.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-24 13:14   ` Christian König
  0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2021-06-24 13:14 UTC (permalink / raw)
  To: huqiqiao, airlied, daniel; +Cc: amd-gfx, dri-devel, linux-kernel



Am 23.06.21 um 11:12 schrieb huqiqiao:
> kvmalloc_array + __GFP_ZERO is the same with kvcalloc.
>
> Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9acee4a5b2ba..50edc73525b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
>   		unsigned num_entries;
>   
>   		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
> -		entry->entries = kvmalloc_array(num_entries,
> -						sizeof(*entry->entries),
> -						GFP_KERNEL | __GFP_ZERO);
> +		entry->entries = kvcalloc(num_entries,
> +						sizeof(*entry->entries), GFP_KERNEL);

Sounds like a good idea in general, but the indentation on the second 
line seems to be of.

Christian.

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-24 13:14   ` Christian König
  0 siblings, 0 replies; 8+ messages in thread
From: Christian König @ 2021-06-24 13:14 UTC (permalink / raw)
  To: huqiqiao, airlied, daniel; +Cc: amd-gfx, dri-devel, linux-kernel



Am 23.06.21 um 11:12 schrieb huqiqiao:
> kvmalloc_array + __GFP_ZERO is the same with kvcalloc.
>
> Signed-off-by: huqiqiao <huqiqiao@uniontech.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> index 9acee4a5b2ba..50edc73525b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
> @@ -908,9 +908,8 @@ static int amdgpu_vm_alloc_pts(struct amdgpu_device *adev,
>   		unsigned num_entries;
>   
>   		num_entries = amdgpu_vm_num_entries(adev, cursor->level);
> -		entry->entries = kvmalloc_array(num_entries,
> -						sizeof(*entry->entries),
> -						GFP_KERNEL | __GFP_ZERO);
> +		entry->entries = kvcalloc(num_entries,
> +						sizeof(*entry->entries), GFP_KERNEL);

Sounds like a good idea in general, but the indentation on the second 
line seems to be of.

Christian.

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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re:Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
  2021-06-24 13:14   ` Christian König
@ 2021-06-25  1:36     ` 胡奇巧
  -1 siblings, 0 replies; 8+ messages in thread
From: 胡奇巧 @ 2021-06-25  1:36 UTC (permalink / raw)
  To: Christian König , airlied , daniel 
  Cc: amd-gfx , dri-devel , linux-kernel 

[-- Attachment #1: Type: text/html, Size: 2648 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re:Re: [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array
@ 2021-06-25  1:36     ` 胡奇巧
  0 siblings, 0 replies; 8+ messages in thread
From: 胡奇巧 @ 2021-06-25  1:36 UTC (permalink / raw)
  To: Christian König , airlied , daniel 
  Cc: amd-gfx , dri-devel , linux-kernel 

[-- Attachment #1: Type: text/html, Size: 2648 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-25  7:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  9:12 [PATCH] drm/amdgpu:use kvcalloc instead of kvmalloc_array huqiqiao
2021-06-23  9:12 ` huqiqiao
2021-06-23  9:12 ` huqiqiao
2021-06-24 13:14 ` Christian König
2021-06-24 13:14   ` Christian König
2021-06-24 13:14   ` Christian König
2021-06-25  1:36   ` 胡奇巧
2021-06-25  1:36     ` 胡奇巧

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.