]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:27:18 +0000 (00:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 5 Jul 2019 20:54:55 +0000 (15:54 -0500)
commitb0f5f5beb33b381fd596ab422870d3946e94654d
treec158c18f420baa0189ba79d48f704f8b4a9fa5b9
parent14b09fae3d40060140232a4f4e7f5f6323e5de04
drm/amdgpu: Use kmemdup rather than duplicating its implementation

kmemdup is introduced to duplicate a region of memory in a neat way.
Rather than kmalloc/kzalloc + memcpy, which the programmer needs to
write the size twice (sometimes lead to mistakes), kmemdup improves
readability, leads to smaller code and also reduce the chances of mistakes.
Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy.

Reviewed-by: Christian König <Christian.Koenig@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/core/dc_stream.c