mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf
@ 2024-04-23 17:36 Ahmad Fatoum
  2024-04-29 13:47 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-04-23 17:36 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

dma_alloc_coherent() already takes care to zero the memory, so there's
no need to zero it explicitly.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/net/fsl-fman.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/fsl-fman.c b/drivers/net/fsl-fman.c
index bdb23598153f..5528ecccc950 100644
--- a/drivers/net/fsl-fman.c
+++ b/drivers/net/fsl-fman.c
@@ -613,13 +613,10 @@ static int fm_eth_rx_port_parameter_init(struct fm_eth *fm_eth)
 	rx_bd_ring_base = dma_alloc_coherent(sizeof(struct fm_port_bd)
 			* RX_BD_RING_SIZE, DMA_ADDRESS_BROKEN);
 	if (!rx_bd_ring_base)
 		return -ENOMEM;
 
-	memset(rx_bd_ring_base, 0, sizeof(struct fm_port_bd)
-			* RX_BD_RING_SIZE);
-
 	/* alloc Rx buffer from main memory */
 	rx_buf_pool = dma_zalloc(MAX_RXBUF_LEN * RX_BD_RING_SIZE);
 
 	/* save them to fm_eth */
 	fm_eth->rx_bd_ring = rx_bd_ring_base;
@@ -694,12 +691,10 @@ static int fm_eth_tx_port_parameter_init(struct fm_eth *fm_eth)
 	tx_bd_ring_base = dma_alloc_coherent(sizeof(struct fm_port_bd)
 			* TX_BD_RING_SIZE, DMA_ADDRESS_BROKEN);
 	if (!tx_bd_ring_base)
 		return -ENOMEM;
 
-	memset(tx_bd_ring_base, 0, sizeof(struct fm_port_bd)
-			* TX_BD_RING_SIZE);
 	/* save it to fm_eth */
 	fm_eth->tx_bd_ring = tx_bd_ring_base;
 	fm_eth->cur_txbd_idx = 0;
 
 	/* init Tx BDs ring */
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf
  2024-04-23 17:36 [PATCH] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf Ahmad Fatoum
@ 2024-04-29 13:47 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2024-04-29 13:47 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Tue, 23 Apr 2024 19:36:25 +0200, Ahmad Fatoum wrote:
> dma_alloc_coherent() already takes care to zero the memory, so there's
> no need to zero it explicitly.
> 
> 

Applied, thanks!

[1/1] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf
      https://git.pengutronix.de/cgit/barebox/commit/?id=0e5b0c7c11bc (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-29 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 17:36 [PATCH] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf Ahmad Fatoum
2024-04-29 13:47 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox