Trivial powerplay fixup for drm-next-4.9
Subsystems (2)
Applies on top of drm-next-4.9. Please review.
Kind Regards,
Edward O'Callaghan (1):
[PATCH] amd/powerplay: use kmemdup instead of kmalloc + memcpy
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1472956579-26643-1-git-send-email-funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org
PATCH 1/1 amd/powerplay: use kmemdup instead of kmalloc + memcpy
Save a few clocks by replacing calls to kmalloc followed by memcpy with a single call to kmemdup.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -6
@@ -765,15 +765,12 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)PP_CHECK_HW (hwmgr);if (!hwmgr->hardcode_pp_table) { - hwmgr->hardcode_pp_table = -kzalloc (hwmgr->soft_pp_table_size,GFP_KERNEL ); + hwmgr->hardcode_pp_table =kmemdup (hwmgr->soft_pp_table, + hwmgr->soft_pp_table_size, +GFP_KERNEL );if (!hwmgr->hardcode_pp_table)return -ENOMEM ; - -/* to avoid powerplay crash when hardcode pptable is empty */ -memcpy (hwmgr->hardcode_pp_table, hwmgr->soft_pp_table, - hwmgr->soft_pp_table_size); }memcpy (hwmgr->hardcode_pp_table, buf, size);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1472956579-26643-2-git-send-email-funfunctor-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org
Christian König
Reviewed-byRe: [PATCH] amd/powerplay: use kmemdup instead of kmalloc + memcpy
Am 04.09.2016 um 04:36 schrieb Edward O'Callaghan:
Quoted 4 lines
Save a few clocks by replacing calls to kmalloc followed by memcpy with a single call to kmemdup.
Signed-off-by Edward O'Callaghan <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3
-2@@ -765,15 +765,12 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)PP_CHECK_HW (hwmgr);if (!hwmgr->hardcode_pp_table) { - hwmgr->hardcode_pp_table = -kzalloc (hwmgr->soft_pp_table_size,GFP_KERNEL ); + hwmgr->hardcode_pp_table =kmemdup (hwmgr->soft_pp_table, + hwmgr->soft_pp_table_size, +GFP_KERNEL );
drivers/gpu/drm/amd/powerplay/amd_powerplay.c static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size) · line 776
Quoted 10 lines
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +0
-4if (!hwmgr->hardcode_pp_table)return -ENOMEM ; - -/* to avoid powerplay crash when hardcode pptable is empty */ -memcpy (hwmgr->hardcode_pp_table, hwmgr->soft_pp_table, - hwmgr->soft_pp_table_size); }memcpy (hwmgr->hardcode_pp_table, buf, size);
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx