drivers/parport/share.c: use kzalloc
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>
This commit is contained in:
parent
8da01af45e
commit
c32df4e182
1 changed files with 1 additions and 2 deletions
|
@ -282,14 +282,13 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
|
||||||
int device;
|
int device;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
tmp = kmalloc(sizeof(struct parport), GFP_KERNEL);
|
tmp = kzalloc(sizeof(struct parport), GFP_KERNEL);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
printk(KERN_WARNING "parport: memory squeeze\n");
|
printk(KERN_WARNING "parport: memory squeeze\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Init our structure */
|
/* Init our structure */
|
||||||
memset(tmp, 0, sizeof(struct parport));
|
|
||||||
tmp->base = base;
|
tmp->base = base;
|
||||||
tmp->irq = irq;
|
tmp->irq = irq;
|
||||||
tmp->dma = dma;
|
tmp->dma = dma;
|
||||||
|
|
Loading…
Add table
Reference in a new issue