drm/amdgpu: use kmemdup rather than duplicating its implementation
Subsystems (2)
PATCH 1/1 drm/amdgpu: use kmemdup rather than duplicating its implementation
Use kmemdup rather than duplicating its implementation.
Generated by: scripts/coccinelle/api/memdup.cocci
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1 -3
@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }
Quoted 5 lines · Wei Yongjun
Use kmemdup rather than duplicating its implementation.
Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Wei Yongjun <[email protected]>
Thanks for the patch. I'll apply this to -misc once the merge window is closed.
Quoted 25 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-3@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }
Deucher, Alexander
maintainerQuoted 13 lines
-----Original Message-----
From: Sean Paul [mailto:[email protected]]
Sent: Friday, July 29, 2016 3:35 PM
To: Wei Yongjun
Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, Sonny; Liu, Leo; Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; dri-devel; Linux Kernel Mailing List
Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementationQuoted 2 lines · Wei Yongjun
Use kmemdup rather than duplicating its implementation.
Quoted 8 lines
Quoted 3 lines
Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Wei Yongjun <[email protected]>Thanks for the patch. I'll apply this to -misc once the merge window is closed.
Acked-by Sean Paul <[email protected]>
Unless you've already applied this to the misc tree, I'd prefer to take it via the amdgpu tree.
Alex
Quoted 6 lines
Quoted 6 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Quoted 23 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.cdrivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device
Quoted 4 lines
index a46a64c..b779b5f 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device*adev)
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-3size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 15 lines · Alexander
Quoted 15 lines
-----Original Message-----
From: Sean Paul [mailto:[email protected]]
Sent: Friday, July 29, 2016 3:35 PM
To: Wei Yongjun
Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, Sonny; Liu, Leo; Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; dri-devel; Linux Kernel Mailing List
Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementationQuoted 4 lines · Wei Yongjun
Use kmemdup rather than duplicating its implementation.
Generated by:
scripts/coccinelle/api/memdup.cocci
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Wei Yongjun <[email protected]>Thanks for the patch. I'll apply this to -misc once the merge window is closed.
Acked-by Sean Paul <[email protected]>Unless you've already applied this to the misc tree, I'd prefer to take it via the amdgpu tree.
Nope, it's all yours.
Sean
Quoted 31 lines
Alex
Quoted 29 lines
Review
Quoted 7 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.cdrivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device
Quoted 4 lines
index a46a64c..b779b5f 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device*adev)
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-3size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }
Quoted 15 lines · Alexander
Quoted 15 lines
-----Original Message-----
From: Sean Paul [mailto:[email protected]]
Sent: Friday, July 29, 2016 3:35 PM
To: Wei Yongjun
Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, Sonny; Liu, Leo; Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; dri-devel; Linux Kernel Mailing List
Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementationQuoted 4 lines · Wei Yongjun
Use kmemdup rather than duplicating its implementation.
Generated by:
scripts/coccinelle/api/memdup.cocci
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Wei Yongjun <[email protected]>Thanks for the patch. I'll apply this to -misc once the merge window is closed.
Acked-by Sean Paul <[email protected]>Unless you've already applied this to the misc tree, I'd prefer to take it via the amdgpu tree.
I recall Christian NAKing an almost identical patch some time ago. Something about needing memcpy_fromio()?
Yup, it's here: https://lkml.org/lkml/2016/5/19/235
Cheers,
Nicolai
Quoted 32 lines
Alex
Quoted 6 lines
Quoted 6 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Quoted 23 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.cdrivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device
Quoted 4 lines
index a46a64c..b779b5f 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device*adev)
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-3size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }
Quoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Am 01.08.2016 um 14:16 schrieb Nicolai Hähnle:
Quoted 21 lines · Alexander
Quoted 20 lines
Quoted 20 lines
-----Original Message-----
From: Sean Paul [mailto:[email protected]]
Sent: Friday, July 29, 2016 3:35 PM
To: Wei Yongjun
Cc: Deucher, Alexander; Koenig, Christian; Dave Airlie; Jiang, Sonny; Liu, Leo; Nath, Arindam; Zhou, David(ChunMing); Zhou, Jammy; Liu, Monk; dri-devel; Linux Kernel Mailing List
Subject: Re: [PATCH -next] drm/amdgpu: use kmemdup rather than duplicating its implementationQuoted 5 lines · Wei Yongjun
Use kmemdup rather than duplicating its implementation.
Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Wei Yongjun <[email protected]>Thanks for the patch. I'll apply this to -misc once the merge window is closed.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Acked-by Sean Paul <[email protected]>Unless you've already applied this to the misc tree, I'd prefer to take it via the amdgpu tree.
I recall Christian NAKing an almost identical patch some time ago. Something about needing
memcpy_fromio()?Yup, it's here: https://lkml.org/lkml/2016/5/19/235
Yes, exactly. We need memcpy_fromio() and memcpy_toio() in the suspend/resume functions instead of memcpy.
I just didn't had time to test that yet (and that was unfortunately a few month ago already).
So please drop this patch,
Christian.
Quoted 41 lines
Cheers,
NicolaiQuoted 32 lines
Alex
Quoted 6 lines
Quoted 6 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Quoted 23 lines
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.cdrivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c int amdgpu_uvd_suspend(struct amdgpu_device
Quoted 4 lines
index a46a64c..b779b5f 100644
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0@@ -296,12 +296,10 @@ int amdgpu_uvd_suspend(struct amdgpu_device*adev)
Quoted 16 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +1
-3size =amdgpu_bo_size (adev->uvd.vcpu_bo); ptr = adev->uvd.cpu_addr; - adev->uvd.saved_bo =kmalloc (size,GFP_KERNEL ); + adev->uvd.saved_bo =kmemdup (ptr, size,GFP_KERNEL );if (!adev->uvd.saved_bo)return -ENOMEM ; -memcpy (adev->uvd.saved_bo, ptr, size); -return 0 ; }Quoted 5 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel