* [PATCH net-next] net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call
@ 2023-02-12 6:51 Christophe JAILLET
2023-02-14 3:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2023-02-12 6:51 UTC (permalink / raw)
To: Felix Fietkau, John Crispin, Sean Wang, Mark Lee,
Lorenzo Bianconi, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Matthias Brugger, AngeloGioacchino Del Regno
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, netdev,
linux-arm-kernel, linux-mediatek
dma_alloc_coherent() already clears the allocated memory, there is no need
to explicitly call memset().
Moreover, it is likely that the size in the memset() is incorrect and
should be "size * sizeof(*ring->desc)".
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/mediatek/mtk_wed.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_wed.c b/drivers/net/ethernet/mediatek/mtk_wed.c
index 95ac4f71d2b2..95d890870984 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
@@ -787,7 +787,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_device *dev, struct mtk_wed_ring *ring,
ring->desc_size = sizeof(*ring->desc);
ring->size = size;
- memset(ring->desc, 0, size);
return 0;
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call
2023-02-12 6:51 [PATCH net-next] net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call Christophe JAILLET
@ 2023-02-14 3:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-02-14 3:50 UTC (permalink / raw)
To: Christophe JAILLET
Cc: nbd, john, sean.wang, Mark-MC.Lee, lorenzo, davem, edumazet,
kuba, pabeni, matthias.bgg, angelogioacchino.delregno,
linux-kernel, kernel-janitors, netdev, linux-arm-kernel,
linux-mediatek
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Sun, 12 Feb 2023 07:51:51 +0100 you wrote:
> dma_alloc_coherent() already clears the allocated memory, there is no need
> to explicitly call memset().
>
> Moreover, it is likely that the size in the memset() is incorrect and
> should be "size * sizeof(*ring->desc)".
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> [...]
Here is the summary with links:
- [net-next] net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call
https://git.kernel.org/netdev/net-next/c/511b88fedab4
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:[~2023-02-14 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-12 6:51 [PATCH net-next] net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call Christophe JAILLET
2023-02-14 3:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®