a3bb1c5db77ed152c2dddad1d752bda8f641d738
[openwrt/staging/981213.git] /
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
5
6 dma_alloc_coherent() already clears the allocated memory, there is no need
7 to explicitly call memset().
8
9 Moreover, it is likely that the size in the memset() is incorrect and
10 should be "size * sizeof(*ring->desc)".
11
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>
15 ---
16
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
20
21 ring->desc_size = sizeof(*ring->desc);
22 ring->size = size;
23 - memset(ring->desc, 0, size);
24
25 return 0;
26 }