mirror of
https://github.com/torvalds/linux.git
synced 2024-09-20 06:53:04 +00: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:
parent
6d0ebb3904
commit
9e68cc7de8
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user