diff options
author | Joe Perches <joe@perches.com> | 2013-03-15 03:23:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-17 12:50:24 -0400 |
commit | 1f9061d27d3d2028805549c4a306324a48209057 (patch) | |
tree | 7cfb1a92933f5a9bba6745b68b6a964d9e757ef9 /drivers/net/ethernet/sgi | |
parent | 7f9421c264f8a6e6137027a45ae576517f66fa56 (diff) |
drivers:net: dma_alloc_coherent: use __GFP_ZERO instead of memset(, 0)
Reduce the number of calls required to alloc
a zeroed block of memory.
Trivially reduces overall object size.
Other changes around these removals
o Neaten call argument alignment
o Remove an unnecessary OOM message after dma_alloc_coherent failure
o Remove unnecessary gfp_t stack variable
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sgi')
-rw-r--r-- | drivers/net/ethernet/sgi/meth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/sgi/meth.c b/drivers/net/ethernet/sgi/meth.c index 79ad9c94a21b..4bdbaad9932d 100644 --- a/drivers/net/ethernet/sgi/meth.c +++ b/drivers/net/ethernet/sgi/meth.c | |||
@@ -213,10 +213,11 @@ static int meth_init_tx_ring(struct meth_private *priv) | |||
213 | { | 213 | { |
214 | /* Init TX ring */ | 214 | /* Init TX ring */ |
215 | priv->tx_ring = dma_alloc_coherent(NULL, TX_RING_BUFFER_SIZE, | 215 | priv->tx_ring = dma_alloc_coherent(NULL, TX_RING_BUFFER_SIZE, |
216 | &priv->tx_ring_dma, GFP_ATOMIC); | 216 | &priv->tx_ring_dma, |
217 | GFP_ATOMIC | __GFP_ZERO); | ||
217 | if (!priv->tx_ring) | 218 | if (!priv->tx_ring) |
218 | return -ENOMEM; | 219 | return -ENOMEM; |
219 | memset(priv->tx_ring, 0, TX_RING_BUFFER_SIZE); | 220 | |
220 | priv->tx_count = priv->tx_read = priv->tx_write = 0; | 221 | priv->tx_count = priv->tx_read = priv->tx_write = 0; |
221 | mace->eth.tx_ring_base = priv->tx_ring_dma; | 222 | mace->eth.tx_ring_base = priv->tx_ring_dma; |
222 | /* Now init skb save area */ | 223 | /* Now init skb save area */ |