drivers:net: Convert dma_alloc_coherent(...__GFP_ZERO) to dma_zalloc_coherent
__GFP_ZERO is an uncommon flag and perhaps is better not used. static inline dma_zalloc_coherent exists so convert the uses of dma_alloc_coherent with __GFP_ZERO to the more common kernel style with zalloc. Remove memset from the static inline dma_zalloc_coherent and add just one use of __GFP_ZERO instead. Trivially reduces the size of the existing uses of dma_zalloc_coherent. Realign arguments as appropriate. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
afe4fd0624
commit
ede23fa816
@@ -778,10 +778,9 @@ static int ftgmac100_alloc_buffers(struct ftgmac100 *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
priv->descs = dma_alloc_coherent(priv->dev,
|
||||
sizeof(struct ftgmac100_descs),
|
||||
&priv->descs_dma_addr,
|
||||
GFP_KERNEL | __GFP_ZERO);
|
||||
priv->descs = dma_zalloc_coherent(priv->dev,
|
||||
sizeof(struct ftgmac100_descs),
|
||||
&priv->descs_dma_addr, GFP_KERNEL);
|
||||
if (!priv->descs)
|
||||
return -ENOMEM;
|
||||
|
||||
|
@@ -732,10 +732,10 @@ static int ftmac100_alloc_buffers(struct ftmac100 *priv)
|
||||
{
|
||||
int i;
|
||||
|
||||
priv->descs = dma_alloc_coherent(priv->dev,
|
||||
sizeof(struct ftmac100_descs),
|
||||
&priv->descs_dma_addr,
|
||||
GFP_KERNEL | __GFP_ZERO);
|
||||
priv->descs = dma_zalloc_coherent(priv->dev,
|
||||
sizeof(struct ftmac100_descs),
|
||||
&priv->descs_dma_addr,
|
||||
GFP_KERNEL);
|
||||
if (!priv->descs)
|
||||
return -ENOMEM;
|
||||
|
||||
|
Reference in New Issue
Block a user