2023-03-04 18:11:37 +00:00
|
|
|
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
|
|
|
|
Date: Sun, 12 Feb 2023 07:51:51 +0100
|
|
|
|
Subject: [PATCH] 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 <christophe.jaillet@wanadoo.fr>
|
|
|
|
Link: https://lore.kernel.org/r/d5acce7dd108887832c9719f62c7201b4c83b3fb.1676184599.git.christophe.jaillet@wanadoo.fr
|
|
|
|
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
|
|
---
|
|
|
|
|
|
|
|
--- a/drivers/net/ethernet/mediatek/mtk_wed.c
|
|
|
|
+++ b/drivers/net/ethernet/mediatek/mtk_wed.c
|
2024-03-29 21:21:51 +00:00
|
|
|
@@ -779,7 +779,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_de
|
2023-03-04 18:11:37 +00:00
|
|
|
|
|
|
|
ring->desc_size = sizeof(*ring->desc);
|
|
|
|
ring->size = size;
|
|
|
|
- memset(ring->desc, 0, size);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|