1
0

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>
Este cometimento está contido em:
Joe Perches
2013-03-15 07:23:58 +00:00
cometido por David S. Miller
ascendente 7f9421c264
cometimento 1f9061d27d
38 ficheiros modificados com 104 adições e 168 eliminações

Ver ficheiro

@@ -441,12 +441,11 @@ static int pasemi_mac_setup_rx_resources(const struct net_device *dev)
ring->buffers = dma_alloc_coherent(&mac->dma_pdev->dev,
RX_RING_SIZE * sizeof(u64),
&ring->buf_dma, GFP_KERNEL);
&ring->buf_dma,
GFP_KERNEL | __GFP_ZERO);
if (!ring->buffers)
goto out_ring_desc;
memset(ring->buffers, 0, RX_RING_SIZE * sizeof(u64));
write_dma_reg(PAS_DMA_RXCHAN_BASEL(chno),
PAS_DMA_RXCHAN_BASEL_BRBL(ring->chan.ring_dma));