]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit03e7b2a0b0134b8de029a6adfb891588efa6fd31
tree25fa844f1e9561b15632cdb4876070a13dfda2b1
parente134f31ec031b38665b73fa334a4ee91e7b7f02f
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