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>
This commit is contained in:

committed by
David S. Miller

parent
7f9421c264
commit
1f9061d27d
@@ -854,12 +854,11 @@ bnx2_alloc_mem(struct bnx2 *bp)
|
||||
sizeof(struct statistics_block);
|
||||
|
||||
status_blk = dma_alloc_coherent(&bp->pdev->dev, bp->status_stats_size,
|
||||
&bp->status_blk_mapping, GFP_KERNEL);
|
||||
&bp->status_blk_mapping,
|
||||
GFP_KERNEL | __GFP_ZERO);
|
||||
if (status_blk == NULL)
|
||||
goto alloc_mem_err;
|
||||
|
||||
memset(status_blk, 0, bp->status_stats_size);
|
||||
|
||||
bnapi = &bp->bnx2_napi[0];
|
||||
bnapi->status_blk.msi = status_blk;
|
||||
bnapi->hw_tx_cons_ptr =
|
||||
|
Reference in New Issue
Block a user