drivers/parport/share.c: use kzalloc
authorAlexandru Gheorghiu <gheorghiuandru@gmail.com>
Wed, 3 Jul 2013 22:09:09 +0000 (15:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 3 Jul 2013 23:08:06 +0000 (16:08 -0700)
Replaced calls to kmalloc and memset with kzalloc.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/parport/share.c

index a848e02e6be3d4537b5dd94c7017ec799cf7becb..6a83ee1e9178c118dabb6f318e40c447aa7d3d6d 100644 (file)
@@ -282,14 +282,13 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
        int device;
        char *name;
 
-       tmp = kmalloc(sizeof(struct parport), GFP_KERNEL);
+       tmp = kzalloc(sizeof(struct parport), GFP_KERNEL);
        if (!tmp) {
                printk(KERN_WARNING "parport: memory squeeze\n");
                return NULL;
        }
 
        /* Init our structure */
-       memset(tmp, 0, sizeof(struct parport));
        tmp->base = base;
        tmp->irq = irq;
        tmp->dma = dma;