mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-01 07:14:19 -04:00
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: Li Zetao <lizetao1@huawei.com> Reviewed-by: Akhil P Oommen <quic_akhilpo@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/609596/ Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
@@ -688,11 +688,9 @@ int adreno_gpu_state_get(struct msm_gpu *gpu, struct msm_gpu_state *state)
|
||||
size = j + 1;
|
||||
|
||||
if (size) {
|
||||
state->ring[i].data = kvmalloc(size << 2, GFP_KERNEL);
|
||||
if (state->ring[i].data) {
|
||||
memcpy(state->ring[i].data, gpu->rb[i]->start, size << 2);
|
||||
state->ring[i].data = kvmemdup(gpu->rb[i]->start, size << 2, GFP_KERNEL);
|
||||
if (state->ring[i].data)
|
||||
state->ring[i].data_size = size << 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user