OSDN Git Service

net/wireless: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:29:34 +0000 (00:29 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 2 Oct 2019 04:16:10 +0000 (07:16 +0300)
commitab8c31dd8c8accea11bd59075bca711579512adc
tree25fa844f1e9561b15632cdb4876070a13dfda2b1
parent0a3ce169476feca7869255c681884ed227a319c8
net/wireless: 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: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath6kl/wmi.c
drivers/net/wireless/st/cw1200/queue.c
drivers/net/wireless/ti/wlcore/main.c