mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] net: fsl-fman: remove superfluous zeroing of new dma_alloc_coherent buf
Date: Tue, 23 Apr 2024 19:36:25 +0200	[thread overview]
Message-ID: <20240423173625.2299942-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-04-23 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 17:36 Ahmad Fatoum [this message]
2024-04-29 13:47 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240423173625.2299942-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox