Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: ethernet: ixp4xx_eth: Use dma_pool_zalloc
@ 2017-11-30 21:22 Vasyl Gomonovych
  2017-11-30 21:32 ` Gomonovych, Vasyl
  0 siblings, 1 reply; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-11-30 21:22 UTC (permalink / raw)
  To: netdev, khalasa, gomonovych; +Cc: linux-kernel

Replacing dma_pool_alloc and memset with a single call to dma_pool_zalloc

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index aee55c03def0..02f7f3e3da8d 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1108,10 +1108,10 @@ static int init_queues(struct port *port)
 			return -ENOMEM;
 	}
 
-	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
-					      &port->desc_tab_phys)))
+	port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL,
+					 &port->desc_tab_phys);
+	if (!port->desc_tab)
 		return -ENOMEM;
-	memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
 	memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
 	memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
 
-- 
1.9.1

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

end of thread, other threads:[~2017-11-30 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-30 21:22 [PATCH] net: ethernet: ixp4xx_eth: Use dma_pool_zalloc Vasyl Gomonovych
2017-11-30 21:32 ` Gomonovych, Vasyl

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