From 122f81d773a464220d64f1a382bde073df281d5a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 29 Dec 2011 11:36:19 +0200 Subject: mtd: docprobe: use kzalloc instead Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'. Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- drivers/mtd/devices/docprobe.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/mtd') diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 45116bb30297..706b847b46b3 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c @@ -241,8 +241,7 @@ static void __init DoC_Probe(unsigned long physadr) return; } docfound = 1; - mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); - + mtd = kzalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); if (!mtd) { printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n"); iounmap(docptr); @@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr) } this = (struct DiskOnChip *)(&mtd[1]); - - memset((char *)mtd,0, sizeof(struct mtd_info)); - memset((char *)this, 0, sizeof(struct DiskOnChip)); - mtd->priv = this; this->virtadr = docptr; this->physadr = physadr; -- cgit v1.2.3-55-g7522