* [PATCH] drm: amd: Use kmemdup instead of duplicating its function
@ 2018-09-18 15:35 zhong jiang
2018-09-21 14:13 ` zhong jiang
2018-10-11 22:37 ` Felix Kuehling
0 siblings, 2 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-18 15:35 UTC (permalink / raw)
To: airlied, alexander.deucher
Cc: oded.gabbay, christian.koenig, David1.Zhou, dri-devel,
linux-kernel
kmemdup has implemented the function that kmalloc() + memcpy().
We prefer to kmemdup rather than code opened implementation.
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index ee49960..8ddd585 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
@@ -747,12 +747,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
return -ENODATA;
}
- pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
+ pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL);
if (!pcrat_image)
return -ENOMEM;
- memcpy(pcrat_image, crat_table, crat_table->length);
-
*crat_image = pcrat_image;
*size = crat_table->length;
--
1.7.12.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: amd: Use kmemdup instead of duplicating its function
2018-09-18 15:35 [PATCH] drm: amd: Use kmemdup instead of duplicating its function zhong jiang
@ 2018-09-21 14:13 ` zhong jiang
2018-10-11 22:37 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: zhong jiang @ 2018-09-21 14:13 UTC (permalink / raw)
To: airlied, alexander.deucher
Cc: oded.gabbay, christian.koenig, David1.Zhou, dri-devel,
linux-kernel, amd-gfx, Harry Wentland
+cc amd-gfx@lists.freedesktop.org
Thanks,
zhong jiang
On 2018/9/18 23:35, zhong jiang wrote:
> kmemdup has implemented the function that kmalloc() + memcpy().
> We prefer to kmemdup rather than code opened implementation.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> index ee49960..8ddd585 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> @@ -747,12 +747,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
> return -ENODATA;
> }
>
> - pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
> + pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL);
> if (!pcrat_image)
> return -ENOMEM;
>
> - memcpy(pcrat_image, crat_table, crat_table->length);
> -
> *crat_image = pcrat_image;
> *size = crat_table->length;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm: amd: Use kmemdup instead of duplicating its function
2018-09-18 15:35 [PATCH] drm: amd: Use kmemdup instead of duplicating its function zhong jiang
2018-09-21 14:13 ` zhong jiang
@ 2018-10-11 22:37 ` Felix Kuehling
1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2018-10-11 22:37 UTC (permalink / raw)
To: zhong jiang, airlied, alexander.deucher
Cc: christian.koenig, dri-devel, linux-kernel
Hi Zhong Jiang,
Sorry for the late response. I just saw this while catching up with my
backlog after travelling end of September.
I applied your patch to amd-staging-drm-next. I only changed the
headline slightly to use the "drm/admkfd: " prefix that we commonly use
for KFD changes.
Regards,
Felix
On 2018-09-18 11:35 AM, zhong jiang wrote:
> kmemdup has implemented the function that kmalloc() + memcpy().
> We prefer to kmemdup rather than code opened implementation.
>
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> index ee49960..8ddd585 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> @@ -747,12 +747,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
> return -ENODATA;
> }
>
> - pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
> + pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL);
> if (!pcrat_image)
> return -ENOMEM;
>
> - memcpy(pcrat_image, crat_table, crat_table->length);
> -
> *crat_image = pcrat_image;
> *size = crat_table->length;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-11 22:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-18 15:35 [PATCH] drm: amd: Use kmemdup instead of duplicating its function zhong jiang
2018-09-21 14:13 ` zhong jiang
2018-10-11 22:37 ` Felix Kuehling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox