mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [KJ] replacing kmalloc with kzalloc in drivers/mtd/devices/docprobe.c
@ 2007-08-13  9:56 Surya Prabhakar N
  0 siblings, 0 replies; only message in thread
From: Surya Prabhakar N @ 2007-08-13  9:56 UTC (permalink / raw)
  To: dwmw2, linux-mtd; +Cc: Linux Kernel, kernel-janitors

Hi,
   Replacing kmalloc with kzalloc and cleaning up memset in
drivers/mtd/devices/docprobe.c.


Signed-off-by: Surya Prabhakar <surya.prabhakar@wipro.com>
---

diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index 54aa759..53be397 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -254,7 +254,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");
@@ -264,9 +264,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;

--
thanks
surya.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-13 13:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-13  9:56 [KJ] replacing kmalloc with kzalloc in drivers/mtd/devices/docprobe.c Surya Prabhakar N

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®