diff options
author | shemminger@osdl.org <shemminger@osdl.org> | 2005-10-26 15:16:08 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 12:18:52 -0400 |
commit | b2f5ad4fec76e78103e7fbb4e808587ea8a6d824 (patch) | |
tree | 54d767fefe3be4e4c746e0b224131dc0ccbbb588 | |
parent | 488f84fd901cd3386f5723a3573ea2e1f55af537 (diff) |
[PATCH] sky2: use kzalloc
Can use kzalloc to save a little code.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r-- | drivers/net/sky2.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 06beb71cb3c8..f5b101bf469e 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -910,12 +910,11 @@ static int sky2_up(struct net_device *dev) | |||
910 | if (!sky2->tx_le) | 910 | if (!sky2->tx_le) |
911 | goto err_out; | 911 | goto err_out; |
912 | 912 | ||
913 | sky2->tx_ring = kmalloc(TX_RING_SIZE * sizeof(struct ring_info), | 913 | sky2->tx_ring = kzalloc(TX_RING_SIZE * sizeof(struct ring_info), |
914 | GFP_KERNEL); | 914 | GFP_KERNEL); |
915 | if (!sky2->tx_ring) | 915 | if (!sky2->tx_ring) |
916 | goto err_out; | 916 | goto err_out; |
917 | sky2->tx_prod = sky2->tx_cons = 0; | 917 | sky2->tx_prod = sky2->tx_cons = 0; |
918 | memset(sky2->tx_ring, 0, TX_RING_SIZE * sizeof(struct ring_info)); | ||
919 | 918 | ||
920 | sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, | 919 | sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, |
921 | &sky2->rx_le_map); | 920 | &sky2->rx_le_map); |
@@ -923,7 +922,7 @@ static int sky2_up(struct net_device *dev) | |||
923 | goto err_out; | 922 | goto err_out; |
924 | memset(sky2->rx_le, 0, RX_LE_BYTES); | 923 | memset(sky2->rx_le, 0, RX_LE_BYTES); |
925 | 924 | ||
926 | sky2->rx_ring = kmalloc(sky2->rx_pending * sizeof(struct ring_info), | 925 | sky2->rx_ring = kzalloc(sky2->rx_pending * sizeof(struct ring_info), |
927 | GFP_KERNEL); | 926 | GFP_KERNEL); |
928 | if (!sky2->rx_ring) | 927 | if (!sky2->rx_ring) |
929 | goto err_out; | 928 | goto err_out; |