]> err.no Git - linux-2.6/commitdiff
[PATCH] sky2: use kzalloc
authorshemminger@osdl.org <shemminger@osdl.org>
Wed, 26 Oct 2005 19:16:08 +0000 (12:16 -0700)
committerJeff Garzik <jgarzik@pobox.com>
Fri, 28 Oct 2005 16:18:52 +0000 (12:18 -0400)
Can use kzalloc to save a little code.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
drivers/net/sky2.c

index 06beb71cb3c895c92e34ac5a70c409128f7b3d39..f5b101bf469e3354388c8abdaa9f6763b995febd 100644 (file)
@@ -910,12 +910,11 @@ static int sky2_up(struct net_device *dev)
        if (!sky2->tx_le)
                goto err_out;
 
-       sky2->tx_ring = kmalloc(TX_RING_SIZE * sizeof(struct ring_info),
+       sky2->tx_ring = kzalloc(TX_RING_SIZE * sizeof(struct ring_info),
                                GFP_KERNEL);
        if (!sky2->tx_ring)
                goto err_out;
        sky2->tx_prod = sky2->tx_cons = 0;
-       memset(sky2->tx_ring, 0, TX_RING_SIZE * sizeof(struct ring_info));
 
        sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES,
                                           &sky2->rx_le_map);
@@ -923,7 +922,7 @@ static int sky2_up(struct net_device *dev)
                goto err_out;
        memset(sky2->rx_le, 0, RX_LE_BYTES);
 
-       sky2->rx_ring = kmalloc(sky2->rx_pending * sizeof(struct ring_info),
+       sky2->rx_ring = kzalloc(sky2->rx_pending * sizeof(struct ring_info),
                                GFP_KERNEL);
        if (!sky2->rx_ring)
                goto err_out;