diff options
author | Muhammad Falak R Wani <falakreyaz@gmail.com> | 2016-05-19 07:15:29 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-05-19 11:00:33 -0400 |
commit | 510e65dfb0e1817ef48c43839b8789131800a6f6 (patch) | |
tree | 59a96ae0100735d48c7e3b3389aeff5d56ff4216 | |
parent | 761de5f9da8306c80c75883e0cbaa78f0244c1a0 (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>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c index 7c3f82b29402..16fed487973b 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | |||
@@ -6056,11 +6056,11 @@ static int tonga_get_pp_table(struct pp_hwmgr *hwmgr, char **table) | |||
6056 | struct tonga_hwmgr *data = (struct tonga_hwmgr *)(hwmgr->backend); | 6056 | struct tonga_hwmgr *data = (struct tonga_hwmgr *)(hwmgr->backend); |
6057 | 6057 | ||
6058 | if (!data->soft_pp_table) { | 6058 | if (!data->soft_pp_table) { |
6059 | data->soft_pp_table = kzalloc(hwmgr->soft_pp_table_size, GFP_KERNEL); | 6059 | data->soft_pp_table = kmemdup(hwmgr->soft_pp_table, |
6060 | hwmgr->soft_pp_table_size, | ||
6061 | GFP_KERNEL); | ||
6060 | if (!data->soft_pp_table) | 6062 | if (!data->soft_pp_table) |
6061 | return -ENOMEM; | 6063 | return -ENOMEM; |
6062 | memcpy(data->soft_pp_table, hwmgr->soft_pp_table, | ||
6063 | hwmgr->soft_pp_table_size); | ||
6064 | } | 6064 | } |
6065 | 6065 | ||
6066 | *table = (char *)&data->soft_pp_table; | 6066 | *table = (char *)&data->soft_pp_table; |