aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib/ipoib_main.c
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2005-11-02 10:23:14 -0500
committerRoland Dreier <rolandd@cisco.com>2005-11-02 10:23:14 -0500
commitde6eb66b56d9df5ce6bd254994f05e065214e8cd (patch)
tree7463446a05b5e9a5d2fc400da0be8d4a6c2ff6f1 /drivers/infiniband/ulp/ipoib/ipoib_main.c
parent7b28b0d000eeb62d77add636f5d6eb0da04e48aa (diff)
[IB] kzalloc() conversions
Replace kmalloc()+memset(,0,) with kzalloc(), for a net savings of 35 source lines and about 500 bytes of text. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 273d5f418a67..8b67db868306 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -729,25 +729,21 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port)
729 729
730 /* Allocate RX/TX "rings" to hold queued skbs */ 730 /* Allocate RX/TX "rings" to hold queued skbs */
731 731
732 priv->rx_ring = kmalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf), 732 priv->rx_ring = kzalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf),
733 GFP_KERNEL); 733 GFP_KERNEL);
734 if (!priv->rx_ring) { 734 if (!priv->rx_ring) {
735 printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n", 735 printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n",
736 ca->name, IPOIB_RX_RING_SIZE); 736 ca->name, IPOIB_RX_RING_SIZE);
737 goto out; 737 goto out;
738 } 738 }
739 memset(priv->rx_ring, 0,
740 IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf));
741 739
742 priv->tx_ring = kmalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf), 740 priv->tx_ring = kzalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf),
743 GFP_KERNEL); 741 GFP_KERNEL);
744 if (!priv->tx_ring) { 742 if (!priv->tx_ring) {
745 printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", 743 printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n",
746 ca->name, IPOIB_TX_RING_SIZE); 744 ca->name, IPOIB_TX_RING_SIZE);
747 goto out_rx_ring_cleanup; 745 goto out_rx_ring_cleanup;
748 } 746 }
749 memset(priv->tx_ring, 0,
750 IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf));
751 747
752 /* priv->tx_head & tx_tail are already 0 */ 748 /* priv->tx_head & tx_tail are already 0 */
753 749