Commit 05be9463 authored by Cai Huoqing's avatar Cai Huoqing Committed by David S. Miller

net: ethernet: ixp4xx: Make use of dma_pool_zalloc() instead of dma_pool_alloc/memset()

Replacing dma_pool_alloc/memset() with dma_pool_zalloc()
to simplify the code.
Signed-off-by: default avatarCai Huoqing <caihuoqing@baidu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07fab5a4
...@@ -1103,10 +1103,9 @@ static int init_queues(struct port *port) ...@@ -1103,10 +1103,9 @@ static int init_queues(struct port *port)
return -ENOMEM; return -ENOMEM;
} }
if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL, port->desc_tab = dma_pool_zalloc(dma_pool, GFP_KERNEL, &port->desc_tab_phys);
&port->desc_tab_phys))) if (!port->desc_tab)
return -ENOMEM; return -ENOMEM;
memset(port->desc_tab, 0, POOL_ALLOC_SIZE);
memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */ memset(port->rx_buff_tab, 0, sizeof(port->rx_buff_tab)); /* tables */
memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab)); memset(port->tx_buff_tab, 0, sizeof(port->tx_buff_tab));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment