aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorMuhammad Falak R Wani <falakreyaz@gmail.com>2016-05-19 07:15:27 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-05-19 11:00:07 -0400
commit761de5f9da8306c80c75883e0cbaa78f0244c1a0 (patch)
treeb6c8909015ca2ca4ea44db6760a5c3ed25404ce4 /drivers/gpu/drm/amd
parent3b59c344ab6e2d00b0f4ad946024572618c87502 (diff)
drm/amd/powerplay/hwmgr: use kmemdup
Use kmemdup when some other buffer is immediately copied into allocated region. It replaces call to allocation followed by memcpy, by a single call to kmemdup. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
index 6f1bad41381a..24a16e49b571 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c
@@ -5074,11 +5074,11 @@ static int fiji_get_pp_table(struct pp_hwmgr *hwmgr, char **table)
5074 struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend); 5074 struct fiji_hwmgr *data = (struct fiji_hwmgr *)(hwmgr->backend);
5075 5075
5076 if (!data->soft_pp_table) { 5076 if (!data->soft_pp_table) {
5077 data->soft_pp_table = kzalloc(hwmgr->soft_pp_table_size, GFP_KERNEL); 5077 data->soft_pp_table = kmemdup(hwmgr->soft_pp_table,
5078 hwmgr->soft_pp_table_size,
5079 GFP_KERNEL);
5078 if (!data->soft_pp_table) 5080 if (!data->soft_pp_table)
5079 return -ENOMEM; 5081 return -ENOMEM;
5080 memcpy(data->soft_pp_table, hwmgr->soft_pp_table,
5081 hwmgr->soft_pp_table_size);
5082 } 5082 }
5083 5083
5084 *table = (char *)&data->soft_pp_table; 5084 *table = (char *)&data->soft_pp_table;