Skip to content

Commit 511b88f

Browse files
tititiou36kuba-moo
authored andcommitted
net: ethernet: mtk_wed: No need to clear memory after a dma_alloc_coherent() call
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 <[email protected]> Link: https://lore.kernel.org/r/d5acce7dd108887832c9719f62c7201b4c83b3fb.1676184599.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ef01749 commit 511b88f

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/net/ethernet/mediatek/mtk_wed.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_device *dev, struct mtk_wed_ring *ring,
787787

788788
ring->desc_size = sizeof(*ring->desc);
789789
ring->size = size;
790-
memset(ring->desc, 0, size);
791790

792791
return 0;
793792
}

0 commit comments

Comments
 (0)