aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/faraday
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-08-27 01:45:23 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-29 21:55:23 -0400
commitede23fa8161c1a04aa1b3bf5447812ca14b3fef1 (patch)
tree783051ba0b2e2c7e4b9f8c5bca53282cb2ad314e /drivers/net/ethernet/faraday
parentafe4fd062416b158a8a8538b23adc1930a9b88dc (diff)
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>
Diffstat (limited to 'drivers/net/ethernet/faraday')
-rw-r--r--drivers/net/ethernet/faraday/ftgmac100.c7
-rw-r--r--drivers/net/ethernet/faraday/ftmac100.c8
2 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 934e1ae279f0..212f44b3a773 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -778,10 +778,9 @@ static int ftgmac100_alloc_buffers(struct ftgmac100 *priv)
778{ 778{
779 int i; 779 int i;
780 780
781 priv->descs = dma_alloc_coherent(priv->dev, 781 priv->descs = dma_zalloc_coherent(priv->dev,
782 sizeof(struct ftgmac100_descs), 782 sizeof(struct ftgmac100_descs),
783 &priv->descs_dma_addr, 783 &priv->descs_dma_addr, GFP_KERNEL);
784 GFP_KERNEL | __GFP_ZERO);
785 if (!priv->descs) 784 if (!priv->descs)
786 return -ENOMEM; 785 return -ENOMEM;
787 786
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index 4658f4cc1969..8be5b40c0a12 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -732,10 +732,10 @@ static int ftmac100_alloc_buffers(struct ftmac100 *priv)
732{ 732{
733 int i; 733 int i;
734 734
735 priv->descs = dma_alloc_coherent(priv->dev, 735 priv->descs = dma_zalloc_coherent(priv->dev,
736 sizeof(struct ftmac100_descs), 736 sizeof(struct ftmac100_descs),
737 &priv->descs_dma_addr, 737 &priv->descs_dma_addr,
738 GFP_KERNEL | __GFP_ZERO); 738 GFP_KERNEL);
739 if (!priv->descs) 739 if (!priv->descs)
740 return -ENOMEM; 740 return -ENOMEM;
741 741