isdn: Convert vmalloc/memset to vzalloc
authorJoe Perches <joe@perches.com>
Sat, 28 May 2011 17:36:26 +0000 (10:36 -0700)
committerJiri Kosina <jkosina@suse.cz>
Thu, 15 Sep 2011 11:55:03 +0000 (13:55 +0200)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/isdn/i4l/isdn_common.c
drivers/isdn/mISDN/dsp_core.c
drivers/isdn/mISDN/l1oip_codec.c

index 6ed82add6ffa8bcebb0b32b85daa84c15a8b56ed..6ddb795e31c50e371eb36d0dbd3dcda23f11978b 100644 (file)
@@ -2308,11 +2308,11 @@ static int __init isdn_init(void)
        int i;
        char tmprev[50];
 
-       if (!(dev = vmalloc(sizeof(isdn_dev)))) {
+       dev = vzalloc(sizeof(isdn_dev));
+       if (!dev) {
                printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
                return -EIO;
        }
-       memset((char *) dev, 0, sizeof(isdn_dev));
        init_timer(&dev->timer);
        dev->timer.function = isdn_timer_funct;
        spin_lock_init(&dev->lock);
index 2877291a9ed8a852937b25ebe59e09043097376d..0c41553ce6847ad4ae12669ecc81737e8d2e2273 100644 (file)
@@ -1052,12 +1052,11 @@ dspcreate(struct channel_req *crq)
        if (crq->protocol != ISDN_P_B_L2DSP
         && crq->protocol != ISDN_P_B_L2DSPHDLC)
                return -EPROTONOSUPPORT;
-       ndsp = vmalloc(sizeof(struct dsp));
+       ndsp = vzalloc(sizeof(struct dsp));
        if (!ndsp) {
                printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__);
                return -ENOMEM;
        }
-       memset(ndsp, 0, sizeof(struct dsp));
        if (dsp_debug & DEBUG_DSP_CTRL)
                printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__);
 
index bbfd1b863ed3da49f95138ed3389c2ba4336df05..5a89972624d8c9ac0cf399b11caba2c3098138b0 100644 (file)
@@ -330,14 +330,12 @@ l1oip_4bit_alloc(int ulaw)
                return 0;
 
        /* alloc conversion tables */
-       table_com = vmalloc(65536);
-       table_dec = vmalloc(512);
+       table_com = vzalloc(65536);
+       table_dec = vzalloc(512);
        if (!table_com || !table_dec) {
                l1oip_4bit_free();
                return -ENOMEM;
        }
-       memset(table_com, 0, 65536);
-       memset(table_dec, 0, 512);
        /* generate compression table */
        i1 = 0;
        while (i1 < 256) {