OSDN Git Service

media: media/tuners: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:28:48 +0000 (13:28 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 14 Aug 2019 08:03:11 +0000 (05:03 -0300)
commit48059784ebac75a98e024c29ab301e05a8b8012f
tree23cc37e91ad214bd5db1c87d14283f7ca72865b5
parent771560e5d341dc61f9e87bc715f3dbb4efe6ec62
media: media/tuners: Use kmemdup rather than duplicating its implementation

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: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/tuners/tuner-xc2028.c
drivers/media/tuners/xc4000.c