media: mediatek: vcodec: Use kmemdup rather than kmalloc/memcpy
authorHaowen Bai <baihaowen@meizu.com>
Tue, 24 May 2022 03:42:21 +0000 (04:42 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Jun 2022 09:30:35 +0000 (10:30 +0100)
commit8b0f690de13625c80367bf56fe3ed5eaa5b33b27
treee790aadf21e05df43aee2068e3afb658fe2715e9
parent5c2111c29689239c31e82ee1fe287f03be94a68c
media: mediatek: vcodec: Use kmemdup rather than kmalloc/memcpy

kmemdup is introduced to duplicate a region of memory in a neat way.
Rather than kmalloc/kzalloc + memcpy, which the programmer needs to
write the size twice (sometimes lead to mistakes), kmemdup improves
readability, leads to smaller code and also reduce the chances of mistakes.
Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c