aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-03-14 09:07:21 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-15 08:56:58 -0400
commitd0320f750093d012d3ed69fc1e8b385f654523d5 (patch)
tree1f9c25c892c33275fb85a993e9a274dc5618370b /drivers/net/ethernet/marvell
parent68c45a2da34cb44962c6a48f8e474ec6b7853641 (diff)
drivers:net: Remove dma_alloc_coherent OOM messages
I believe these error messages are already logged on allocation failure by warn_alloc_failed and so get a dump_stack on OOM. Remove the unnecessary additional error logging. Around these deletions: o Alignment neatening. o Remove unnecessary casts of dma_alloc_coherent. o Hoist assigns from ifs. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c14
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c11
2 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index cd345b8969bc..e48261e468f3 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -1969,13 +1969,8 @@ static int mvneta_rxq_init(struct mvneta_port *pp,
1969 rxq->descs = dma_alloc_coherent(pp->dev->dev.parent, 1969 rxq->descs = dma_alloc_coherent(pp->dev->dev.parent,
1970 rxq->size * MVNETA_DESC_ALIGNED_SIZE, 1970 rxq->size * MVNETA_DESC_ALIGNED_SIZE,
1971 &rxq->descs_phys, GFP_KERNEL); 1971 &rxq->descs_phys, GFP_KERNEL);
1972 if (rxq->descs == NULL) { 1972 if (rxq->descs == NULL)
1973 netdev_err(pp->dev,
1974 "rxq=%d: Can't allocate %d bytes for %d RX descr\n",
1975 rxq->id, rxq->size * MVNETA_DESC_ALIGNED_SIZE,
1976 rxq->size);
1977 return -ENOMEM; 1973 return -ENOMEM;
1978 }
1979 1974
1980 BUG_ON(rxq->descs != 1975 BUG_ON(rxq->descs !=
1981 PTR_ALIGN(rxq->descs, MVNETA_CPU_D_CACHE_LINE_SIZE)); 1976 PTR_ALIGN(rxq->descs, MVNETA_CPU_D_CACHE_LINE_SIZE));
@@ -2029,13 +2024,8 @@ static int mvneta_txq_init(struct mvneta_port *pp,
2029 txq->descs = dma_alloc_coherent(pp->dev->dev.parent, 2024 txq->descs = dma_alloc_coherent(pp->dev->dev.parent,
2030 txq->size * MVNETA_DESC_ALIGNED_SIZE, 2025 txq->size * MVNETA_DESC_ALIGNED_SIZE,
2031 &txq->descs_phys, GFP_KERNEL); 2026 &txq->descs_phys, GFP_KERNEL);
2032 if (txq->descs == NULL) { 2027 if (txq->descs == NULL)
2033 netdev_err(pp->dev,
2034 "txQ=%d: Can't allocate %d bytes for %d TX descr\n",
2035 txq->id, txq->size * MVNETA_DESC_ALIGNED_SIZE,
2036 txq->size);
2037 return -ENOMEM; 2028 return -ENOMEM;
2038 }
2039 2029
2040 /* Make sure descriptor address is cache line size aligned */ 2030 /* Make sure descriptor address is cache line size aligned */
2041 BUG_ON(txq->descs != 2031 BUG_ON(txq->descs !=
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 037ed866c22f..3ae4c7f0834d 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1024,11 +1024,9 @@ static int rxq_init(struct net_device *dev)
1024 pep->rx_desc_area_size = size; 1024 pep->rx_desc_area_size = size;
1025 pep->p_rx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size, 1025 pep->p_rx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size,
1026 &pep->rx_desc_dma, GFP_KERNEL); 1026 &pep->rx_desc_dma, GFP_KERNEL);
1027 if (!pep->p_rx_desc_area) { 1027 if (!pep->p_rx_desc_area)
1028 printk(KERN_ERR "%s: Cannot alloc RX ring (size %d bytes)\n",
1029 dev->name, size);
1030 goto out; 1028 goto out;
1031 } 1029
1032 memset((void *)pep->p_rx_desc_area, 0, size); 1030 memset((void *)pep->p_rx_desc_area, 0, size);
1033 /* initialize the next_desc_ptr links in the Rx descriptors ring */ 1031 /* initialize the next_desc_ptr links in the Rx descriptors ring */
1034 p_rx_desc = pep->p_rx_desc_area; 1032 p_rx_desc = pep->p_rx_desc_area;
@@ -1087,11 +1085,8 @@ static int txq_init(struct net_device *dev)
1087 pep->tx_desc_area_size = size; 1085 pep->tx_desc_area_size = size;
1088 pep->p_tx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size, 1086 pep->p_tx_desc_area = dma_alloc_coherent(pep->dev->dev.parent, size,
1089 &pep->tx_desc_dma, GFP_KERNEL); 1087 &pep->tx_desc_dma, GFP_KERNEL);
1090 if (!pep->p_tx_desc_area) { 1088 if (!pep->p_tx_desc_area)
1091 printk(KERN_ERR "%s: Cannot allocate Tx Ring (size %d bytes)\n",
1092 dev->name, size);
1093 goto out; 1089 goto out;
1094 }
1095 memset((void *)pep->p_tx_desc_area, 0, pep->tx_desc_area_size); 1090 memset((void *)pep->p_tx_desc_area, 0, pep->tx_desc_area_size);
1096 /* Initialize the next_desc_ptr links in the Tx descriptors ring */ 1091 /* Initialize the next_desc_ptr links in the Tx descriptors ring */
1097 p_tx_desc = pep->p_tx_desc_area; 1092 p_tx_desc = pep->p_tx_desc_area;