aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell/mv643xx_eth.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-02-03 12:43:58 -0500
committerDavid S. Miller <davem@davemloft.net>2013-02-04 13:22:33 -0500
commitb2adaca92c63b9bb8beb021d554f656e387a7648 (patch)
treeec0ca7c14267dc090435ddbefe29b110912b851f /drivers/net/ethernet/marvell/mv643xx_eth.c
parent09da6c5f60ad2e2018366e47192a9ddbccfb3ac5 (diff)
ethernet: Remove unnecessary alloc/OOM messages, alloc cleanups
alloc failures already get standardized OOM messages and a dump_stack. Convert kzalloc's with multiplies to kcalloc. Convert kmalloc's with multiplies to kmalloc_array. Fix a few whitespace defects. Convert a constant 6 to ETH_ALEN. Use parentheses around sizeof. Convert vmalloc/memset to vzalloc. Remove now unused size variables. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell/mv643xx_eth.c')
-rw-r--r--drivers/net/ethernet/marvell/mv643xx_eth.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index c27b23d8f4fc..29140502b71a 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1879,12 +1879,10 @@ static int rxq_init(struct mv643xx_eth_private *mp, int index)
1879 memset(rxq->rx_desc_area, 0, size); 1879 memset(rxq->rx_desc_area, 0, size);
1880 1880
1881 rxq->rx_desc_area_size = size; 1881 rxq->rx_desc_area_size = size;
1882 rxq->rx_skb = kmalloc(rxq->rx_ring_size * sizeof(*rxq->rx_skb), 1882 rxq->rx_skb = kmalloc_array(rxq->rx_ring_size, sizeof(*rxq->rx_skb),
1883 GFP_KERNEL); 1883 GFP_KERNEL);
1884 if (rxq->rx_skb == NULL) { 1884 if (rxq->rx_skb == NULL)
1885 netdev_err(mp->dev, "can't allocate rx skb ring\n");
1886 goto out_free; 1885 goto out_free;
1887 }
1888 1886
1889 rx_desc = rxq->rx_desc_area; 1887 rx_desc = rxq->rx_desc_area;
1890 for (i = 0; i < rxq->rx_ring_size; i++) { 1888 for (i = 0; i < rxq->rx_ring_size; i++) {