]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
atm: Convert vmalloc/memset to vzalloc
authorJoe Perches <joe@perches.com>
Sat, 28 May 2011 17:36:23 +0000 (10:36 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Sep 2011 11:55:02 +0000 (13:55 +0200)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/atm/idt77252.c
drivers/atm/lanai.c

index be0dbfeb541ce11531b35b1af5ff0bedb58c7ba3..47648535afa7e758a1790078577f78d1bc3f9103 100644 (file)
@@ -3416,27 +3416,28 @@ init_card(struct atm_dev *dev)
 
        size = sizeof(struct vc_map *) * card->tct_size;
        IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size);
-       if (NULL == (card->vcs = vmalloc(size))) {
+       card->vcs = vzalloc(size);
+       if (!card->vcs) {
                printk("%s: memory allocation failure.\n", card->name);
                deinit_card(card);
                return -1;
        }
-       memset(card->vcs, 0, size);
 
        size = sizeof(struct vc_map *) * card->scd_size;
        IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n",
                card->name, size);
-       if (NULL == (card->scd2vc = vmalloc(size))) {
+       card->scd2vc = vzalloc(size);
+       if (!card->scd2vc) {
                printk("%s: memory allocation failure.\n", card->name);
                deinit_card(card);
                return -1;
        }
-       memset(card->scd2vc, 0, size);
 
        size = sizeof(struct tst_info) * (card->tst_size - 2);
        IPRINTK("%s: allocate %d byte for TST to VC mapping.\n",
                card->name, size);
-       if (NULL == (card->soft_tst = vmalloc(size))) {
+       card->soft_tst = vmalloc(size);
+       if (!card->soft_tst) {
                printk("%s: memory allocation failure.\n", card->name);
                deinit_card(card);
                return -1;
index e828c548749398496ecb7297ae4ca818a66a84bb..f5569699f31cb228fe50822140416a937a2636c0 100644 (file)
@@ -1457,10 +1457,9 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)
        return (lanai->vccs == NULL) ? -ENOMEM : 0;
 #else
        int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
-       lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
+       lanai->vccs = vzalloc(bytes);
        if (unlikely(lanai->vccs == NULL))
                return -ENOMEM;
-       memset(lanai->vccs, 0, bytes);
        return 0;
 #endif
 }