* [PATCH] ar5523: Use kzalloc instead of kmalloc/memset
@ 2022-04-19 1:37 Haowen Bai
2022-04-20 10:10 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-04-19 1:37 UTC (permalink / raw)
To: Pontus Fuchs, Kalle Valo, David S. Miller, Jakub Kicinski, Paolo Abeni
Cc: Haowen Bai, linux-wireless, netdev, linux-kernel
Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
drivers/net/wireless/ath/ar5523/ar5523.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c
index 00ddeee123c2..9f84a6fde0c2 100644
--- a/drivers/net/wireless/ath/ar5523/ar5523.c
+++ b/drivers/net/wireless/ath/ar5523/ar5523.c
@@ -1500,7 +1500,7 @@ static int ar5523_load_firmware(struct usb_device *dev)
return -ENOENT;
}
- txblock = kmalloc(sizeof(*txblock), GFP_KERNEL);
+ txblock = kzalloc(sizeof(*txblock), GFP_KERNEL);
if (!txblock)
goto out;
@@ -1512,7 +1512,6 @@ static int ar5523_load_firmware(struct usb_device *dev)
if (!fwbuf)
goto out_free_rxblock;
- memset(txblock, 0, sizeof(struct ar5523_fwblock));
txblock->flags = cpu_to_be32(AR5523_WRITE_BLOCK);
txblock->total = cpu_to_be32(fw->size);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ar5523: Use kzalloc instead of kmalloc/memset
2022-04-19 1:37 [PATCH] ar5523: Use kzalloc instead of kmalloc/memset Haowen Bai
@ 2022-04-20 10:10 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-04-20 10:10 UTC (permalink / raw)
To: Haowen Bai
Cc: pontus.fuchs, kvalo, davem, kuba, pabeni, linux-wireless, netdev,
linux-kernel
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Tue, 19 Apr 2022 09:37:31 +0800 you wrote:
> Use kzalloc rather than duplicating its implementation, which
> makes code simple and easy to understand.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
> drivers/net/wireless/ath/ar5523/ar5523.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Here is the summary with links:
- ar5523: Use kzalloc instead of kmalloc/memset
https://git.kernel.org/netdev/net-next/c/e63dd4123507
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 10:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-19 1:37 [PATCH] ar5523: Use kzalloc instead of kmalloc/memset Haowen Bai
2022-04-20 10:10 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.