Skip to contentSkip to conversation

net: ixp4xx_hss: use dma_pool_zalloc

PATCH Applied Jason Wang 2 participants 2 messages Jul 25, 2021 – Jul 26, 2021

Subsystems (3)
lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH 1/1 net: ixp4xx_hss: use dma_pool_zalloc

The dma_pool_zalloc combines dma_pool_alloc/memset. Therefore, the dma_pool_alloc/memset can be replaced with dma_pool_zalloc which is more compact.

---
 drivers/net/wan/ixp4xx_hss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wan/ixp4xx_hss.c +1 -2
index 3c51ab239fb2..2cebbfca0bd1 100644
@@ -975,11 +975,10 @@ static int init_hdlc_queues(struct port *port)
 			return -ENOMEM;
 	}
 
-	port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
+	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));
 
Signature · 1 line
2.32.0
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 8 lines · On Sun, 25 Jul 2021 22:42:21 +0800 you wrote:

The dma_pool_zalloc combines dma_pool_alloc/memset. Therefore, the dma_pool_alloc/memset can be replaced with dma_pool_zalloc which is more compact.

---
 drivers/net/wan/ixp4xx_hss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Here is the summary with links:
- net: ixp4xx_hss: use dma_pool_zalloc

    https://git.kernel.org/netdev/net-next/c/af996031e154

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html