Commit 9e68cc7d authored by Li Zetao's avatar Li Zetao Committed by Rob Clark

drm/msm/adreno: Use kvmemdup to simplify the code

Use kvmemdup instead of kvmalloc() + memcpy() to simplify the code.

No functional change intended.
Signed-off-by: default avatarLi Zetao <lizetao1@huawei.com>
Reviewed-by: default avatarAkhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/609596/Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
parent 6d0ebb39
...@@ -688,11 +688,9 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state) ...@@ -688,11 +688,9 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state)
size = j + 1; size = j + 1;
if (size) { if (size) {
state->ring[i].data = kvmalloc(size << 2, GFP_KERNEL); state->ring[i].data = kvmemdup(gpu->rb[i]->start, size << 2, GFP_KERNEL);
if (state->ring[i].data) { if (state->ring[i].data)
memcpy(state->ring[i].data, gpu->rb[i]->start, size << 2);
state->ring[i].data_size = size << 2; state->ring[i].data_size = size << 2;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment