Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0320f75 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller
Browse files

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: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68c45a2d
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -1464,14 +1464,10 @@ static int greth_of_probe(struct platform_device *ofdev)
	}

	/* Allocate TX descriptor ring in coherent memory */
	greth->tx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
								   1024,
	greth->tx_bd_base = dma_alloc_coherent(greth->dev, 1024,
					       &greth->tx_bd_base_phys,
					       GFP_KERNEL);

	if (!greth->tx_bd_base) {
		if (netif_msg_probe(greth))
			dev_err(&dev->dev, "could not allocate descriptor memory.\n");
		err = -ENOMEM;
		goto error3;
	}
@@ -1479,14 +1475,10 @@ static int greth_of_probe(struct platform_device *ofdev)
	memset(greth->tx_bd_base, 0, 1024);

	/* Allocate RX descriptor ring in coherent memory */
	greth->rx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
								   1024,
	greth->rx_bd_base = dma_alloc_coherent(greth->dev, 1024,
					       &greth->rx_bd_base_phys,
					       GFP_KERNEL);

	if (!greth->rx_bd_base) {
		if (netif_msg_probe(greth))
			dev_err(greth->dev, "could not allocate descriptor memory.\n");
		err = -ENOMEM;
		goto error4;
	}
+2 −3
Original line number Diff line number Diff line
@@ -1373,10 +1373,9 @@ static int sparc_lance_probe_one(struct platform_device *op,
			dma_alloc_coherent(&op->dev,
					   sizeof(struct lance_init_block),
					   &lp->init_block_dvma, GFP_ATOMIC);
		if (!lp->init_block_mem) {
			printk(KERN_ERR "SunLance: Cannot allocate consistent DMA memory.\n");
		if (!lp->init_block_mem)
			goto fail;
		}

		lp->pio_buffer = 0;
		lp->init_ring = lance_init_ring_dvma;
		lp->rx = lance_rx_dvma;
+6 −10
Original line number Diff line number Diff line
@@ -388,18 +388,14 @@ static int mace_open(struct net_device *dev)
	mp->tx_ring = dma_alloc_coherent(mp->device,
					 N_TX_RING * MACE_BUFF_SIZE,
					 &mp->tx_ring_phys, GFP_KERNEL);
	if (mp->tx_ring == NULL) {
		printk(KERN_ERR "%s: unable to allocate DMA tx buffers\n", dev->name);
	if (mp->tx_ring == NULL)
		goto out1;
	}

	mp->rx_ring = dma_alloc_coherent(mp->device,
					 N_RX_RING * MACE_BUFF_SIZE,
					 &mp->rx_ring_phys, GFP_KERNEL);
	if (mp->rx_ring == NULL) {
		printk(KERN_ERR "%s: unable to allocate DMA rx buffers\n", dev->name);
	if (mp->rx_ring == NULL)
		goto out2;
	}

	mace_dma_off(dev);

+0 −2
Original line number Diff line number Diff line
@@ -864,7 +864,6 @@ static int bcm_enet_open(struct net_device *dev)
	size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
	p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
	if (!p) {
		dev_err(kdev, "cannot allocate rx ring %u\n", size);
		ret = -ENOMEM;
		goto out_freeirq_tx;
	}
@@ -877,7 +876,6 @@ static int bcm_enet_open(struct net_device *dev)
	size = priv->tx_ring_size * sizeof(struct bcm_enet_desc);
	p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
	if (!p) {
		dev_err(kdev, "cannot allocate tx ring\n");
		ret = -ENOMEM;
		goto out_free_rx_ring;
	}
+8 −11
Original line number Diff line number Diff line
@@ -47,19 +47,16 @@ static int at91ether_start(struct net_device *dev)
	int i;

	lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
					MAX_RX_DESCR * sizeof(struct macb_dma_desc),
					 (MAX_RX_DESCR *
					  sizeof(struct macb_dma_desc)),
					 &lp->rx_ring_dma, GFP_KERNEL);
	if (!lp->rx_ring) {
		netdev_err(dev, "unable to alloc rx ring DMA buffer\n");
	if (!lp->rx_ring)
		return -ENOMEM;
	}

	lp->rx_buffers = dma_alloc_coherent(&lp->pdev->dev,
					    MAX_RX_DESCR * MAX_RBUFF_SZ,
					    &lp->rx_buffers_dma, GFP_KERNEL);
	if (!lp->rx_buffers) {
		netdev_err(dev, "unable to alloc rx data DMA buffer\n");

		dma_free_coherent(&lp->pdev->dev,
				  MAX_RX_DESCR * sizeof(struct macb_dma_desc),
				  lp->rx_ring, lp->rx_ring_dma);
Loading