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
@@ -717,12 +717,11 @@ ixgb_setup_tx_resources(struct ixgb_adapter *adapter)
|
||||
txdr->size = ALIGN(txdr->size, 4096);
|
||||
|
||||
txdr->desc = dma_alloc_coherent(&pdev->dev, txdr->size, &txdr->dma,
|
||||
GFP_KERNEL);
|
||||
GFP_KERNEL | __GFP_ZERO);
|
||||
if (!txdr->desc) {
|
||||
vfree(txdr->buffer_info);
|
||||
return -ENOMEM;
|
||||
}
|
||||
memset(txdr->desc, 0, txdr->size);
|
||||
|
||||
txdr->next_to_use = 0;
|
||||
txdr->next_to_clean = 0;
|
||||
|
Reference in New Issue
Block a user