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>
This commit is contained in:

committed by
David S. Miller

parent
68c45a2da3
commit
d0320f7500
@@ -47,22 +47,19 @@ 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),
|
||||
&lp->rx_ring_dma, GFP_KERNEL);
|
||||
if (!lp->rx_ring) {
|
||||
netdev_err(dev, "unable to alloc rx ring DMA buffer\n");
|
||||
(MAX_RX_DESCR *
|
||||
sizeof(struct macb_dma_desc)),
|
||||
&lp->rx_ring_dma, GFP_KERNEL);
|
||||
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);
|
||||
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);
|
||||
MAX_RX_DESCR * sizeof(struct macb_dma_desc),
|
||||
lp->rx_ring, lp->rx_ring_dma);
|
||||
lp->rx_ring = NULL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
Reference in New Issue
Block a user