diff options
author | Alexandru Gheorghiu <gheorghiuandru@gmail.com> | 2013-07-03 18:09:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:08:06 -0400 |
commit | c32df4e182e5bf40edde45da247318986d3cbf91 (patch) | |
tree | 332589694a6905bf75b3d0736a108120b91ed903 /drivers/parport | |
parent | 8da01af45e197110cbce84fb5ccb54645f051ac6 (diff) |
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>
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/share.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index a848e02e6be3..6a83ee1e9178 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c | |||
@@ -282,14 +282,13 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma, | |||
282 | int device; | 282 | int device; |
283 | char *name; | 283 | char *name; |
284 | 284 | ||
285 | tmp = kmalloc(sizeof(struct parport), GFP_KERNEL); | 285 | tmp = kzalloc(sizeof(struct parport), GFP_KERNEL); |
286 | if (!tmp) { | 286 | if (!tmp) { |
287 | printk(KERN_WARNING "parport: memory squeeze\n"); | 287 | printk(KERN_WARNING "parport: memory squeeze\n"); |
288 | return NULL; | 288 | return NULL; |
289 | } | 289 | } |
290 | 290 | ||
291 | /* Init our structure */ | 291 | /* Init our structure */ |
292 | memset(tmp, 0, sizeof(struct parport)); | ||
293 | tmp->base = base; | 292 | tmp->base = base; |
294 | tmp->irq = irq; | 293 | tmp->irq = irq; |
295 | tmp->dma = dma; | 294 | tmp->dma = dma; |