730-15-v6.3-net-ethernet-mtk_wed-No-need-to-clear-memory-after-a.patch 914 B

1234567891011121314151617181920212223242526
  1. From: Christophe JAILLET <[email protected]>
  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. dma_alloc_coherent() already clears the allocated memory, there is no need
  6. to explicitly call memset().
  7. Moreover, it is likely that the size in the memset() is incorrect and
  8. should be "size * sizeof(*ring->desc)".
  9. Signed-off-by: Christophe JAILLET <[email protected]>
  10. Link: https://lore.kernel.org/r/d5acce7dd108887832c9719f62c7201b4c83b3fb.1676184599.git.christophe.jaillet@wanadoo.fr
  11. Signed-off-by: Jakub Kicinski <[email protected]>
  12. ---
  13. --- a/drivers/net/ethernet/mediatek/mtk_wed.c
  14. +++ b/drivers/net/ethernet/mediatek/mtk_wed.c
  15. @@ -779,7 +779,6 @@ mtk_wed_rro_ring_alloc(struct mtk_wed_de
  16. ring->desc_size = sizeof(*ring->desc);
  17. ring->size = size;
  18. - memset(ring->desc, 0, size);
  19. return 0;
  20. }