aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
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/marvell
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/marvell')
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index db481477bcc5..3e69febe377e 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -583,10 +583,9 @@ static int init_hash_table(struct pxa168_eth_private *pep)
583 * table is full. 583 * table is full.
584 */ 584 */
585 if (pep->htpr == NULL) { 585 if (pep->htpr == NULL) {
586 pep->htpr = dma_alloc_coherent(pep->dev->dev.parent, 586 pep->htpr = dma_zalloc_coherent(pep->dev->dev.parent,
587 HASH_ADDR_TABLE_SIZE, 587 HASH_ADDR_TABLE_SIZE,
588 &pep->htpr_dma, 588 &pep->htpr_dma, GFP_KERNEL);
589 GFP_KERNEL | __GFP_ZERO);
590 if (pep->htpr == NULL) 589 if (pep->htpr == NULL)
591 return -ENOMEM; 590 return -ENOMEM;
592 } else { 591 } else {
@@ -1024,9 +1023,9 @@ static int rxq_init(struct net_device *dev)
1024 pep->rx_desc_count = 0; 1023 pep->rx_desc_count = 0;
1025 size = pep->rx_ring_size * sizeof(struct rx_desc); 1024 size = pep->rx_ring_size * sizeof(struct rx_desc);
1026 pep->rx_desc_area_size = size; 1025 pep->rx_desc_area_size = size;
1027 pep->p_rx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size, 1026 pep->p_rx_desc_area = dma_zalloc_coherent(pep->dev->dev.parent, size,
1028 &pep->rx_desc_dma, 1027 &pep->rx_desc_dma,
1029 GFP_KERNEL | __GFP_ZERO); 1028 GFP_KERNEL);
1030 if (!pep->p_rx_desc_area) 1029 if (!pep->p_rx_desc_area)
1031 goto out; 1030 goto out;
1032 1031
@@ -1085,9 +1084,9 @@ static int txq_init(struct net_device *dev)
1085 pep->tx_desc_count = 0; 1084 pep->tx_desc_count = 0;
1086 size = pep->tx_ring_size * sizeof(struct tx_desc); 1085 size = pep->tx_ring_size * sizeof(struct tx_desc);
1087 pep->tx_desc_area_size = size; 1086 pep->tx_desc_area_size = size;
1088 pep->p_tx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size, 1087 pep->p_tx_desc_area = dma_zalloc_coherent(pep->dev->dev.parent, size,
1089 &pep->tx_desc_dma, 1088 &pep->tx_desc_dma,
1090 GFP_KERNEL | __GFP_ZERO); 1089 GFP_KERNEL);
1091 if (!pep->p_tx_desc_area) 1090 if (!pep->p_tx_desc_area)
1092 goto out; 1091 goto out;
1093 /* Initialize the next_desc_ptr links in the Tx descriptors ring */ 1092 /* Initialize the next_desc_ptr links in the Tx descriptors ring */