]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
net: use kcalloc in netdev_queue alloc
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 21 Jul 2008 20:28:44 +0000 (13:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 21 Jul 2008 20:28:44 +0000 (13:28 -0700)
Minor nit, use size_t for allocation size and kcalloc to allocate
an array. Probably makes no actual code difference.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index cbc34c0db3762dd0962ff250078e22679e8d4820..1698b3998981ccf06e4421bbede64296616e2cc0 100644 (file)
@@ -4207,7 +4207,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
 {
        struct netdev_queue *tx;
        struct net_device *dev;
-       int alloc_size;
+       size_t alloc_size;
        void *p;
 
        BUG_ON(strlen(name) >= sizeof(dev->name));
@@ -4227,7 +4227,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
                return NULL;
        }
 
-       tx = kzalloc(sizeof(struct netdev_queue) * queue_count, GFP_KERNEL);
+       tx = kcalloc(queue_count, sizeof(struct netdev_queue), GFP_KERNEL);
        if (!tx) {
                printk(KERN_ERR "alloc_netdev: Unable to allocate "
                       "tx qdiscs.\n");