]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
platform/x86: thinkpad_acpi: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:30:00 +0000 (00:30 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 29 Jul 2019 15:31:48 +0000 (18:31 +0300)
commit35b7c80827e9352b88a2379f06cbb9aa3dd64c14
treee731cc4d7e5c0d708d303d5588fccb10eabd80a5
parent340f25ff1d4fd3bfe0d3e0769261fec8fb32ae9f
platform/x86: thinkpad_acpi: 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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/thinkpad_acpi.c