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>
Cette révision appartient à :

révisé par
David S. Miller

Parent
7f9421c264
révision
1f9061d27d
@@ -1070,11 +1070,10 @@ static int dfx_driver_init(struct net_device *dev, const char *print_name,
|
||||
(PI_ALIGN_K_DESC_BLK - 1);
|
||||
bp->kmalloced = top_v = dma_alloc_coherent(bp->bus_dev, alloc_size,
|
||||
&bp->kmalloced_dma,
|
||||
GFP_ATOMIC);
|
||||
GFP_ATOMIC | __GFP_ZERO);
|
||||
if (top_v == NULL)
|
||||
return DFX_K_FAILURE;
|
||||
|
||||
memset(top_v, 0, alloc_size); /* zero out memory before continuing */
|
||||
top_p = bp->kmalloced_dma; /* get physical address of buffer */
|
||||
|
||||
/*
|
||||
|
Référencer dans un nouveau ticket
Bloquer un utilisateur