net: systemport: use kcalloc instead of kzalloc
authorFlorian Fainelli <f.fainelli@gmail.com>
Thu, 10 Jul 2014 00:36:47 +0000 (17:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Jul 2014 01:19:54 +0000 (18:19 -0700)
checkpatch.pl flagged two uses of kzalloc() for allocating and zeroing
arrays, use kcalloc() instead as recommended.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bcmsysport.c

index b6e4c7b418be396f52d99b9b6c7a74fac3434430..31b5340c685e38943634c3cca0e80939098426a6 100644 (file)
@@ -1095,7 +1095,7 @@ static int bcm_sysport_init_tx_ring(struct bcm_sysport_priv *priv,
                return -ENOMEM;
        }
 
-       ring->cbs = kzalloc(sizeof(struct bcm_sysport_cb) * size, GFP_KERNEL);
+       ring->cbs = kcalloc(size, sizeof(struct bcm_sysport_cb), GFP_KERNEL);
        if (!ring->cbs) {
                netif_err(priv, hw, priv->netdev, "CB allocation failed\n");
                return -ENOMEM;
@@ -1238,8 +1238,8 @@ static int bcm_sysport_init_rx_ring(struct bcm_sysport_priv *priv)
        priv->rx_bd_assign_index = 0;
        priv->rx_c_index = 0;
        priv->rx_read_ptr = 0;
-       priv->rx_cbs = kzalloc(priv->num_rx_bds *
-                               sizeof(struct bcm_sysport_cb), GFP_KERNEL);
+       priv->rx_cbs = kcalloc(priv->num_rx_bds, sizeof(struct bcm_sysport_cb),
+                               GFP_KERNEL);
        if (!priv->rx_cbs) {
                netif_err(priv, hw, priv->netdev, "CB allocation failed\n");
                return -ENOMEM;