1 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
2 Date: Sun, 12 Feb 2023 07:51:51 +0100
3 Subject: [PATCH] net: ethernet: mtk_wed: No need to clear memory after a
4 dma_alloc_coherent() call
6 dma_alloc_coherent() already clears the allocated memory, there is no need
7 to explicitly call memset().
9 Moreover, it is likely that the size in the memset() is incorrect and
10 should be "size * sizeof(*ring->desc)".
12 Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
13 Link: https://lore.kernel.org/r/d5acce7dd108887832c9719f62c7201b4c83b3fb.1676184599.git.christophe.jaillet@wanadoo.fr
14 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
17 --- a/drivers/net/ethernet/mediatek/mtk_wed.c
18 +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
19 @@ -779,7 +779,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_de
21 ring->desc_size = sizeof(*ring->desc);
23 - memset(ring->desc, 0, size);