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

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


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

diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index 58e561e..ba5fc39 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1853,14 +1853,12 @@ static int cfi_jedec_setup(struct cfi_private *p_cfi, int index)
 
 	num_erase_regions = jedec_table[index].NumEraseRegions;
 
-	p_cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
+	p_cfi->cfiq = kzalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL);
 	if (!p_cfi->cfiq) {
 		//xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name);
 		return 0;
 	}
 
-	memset(p_cfi->cfiq,0,sizeof(struct cfi_ident));
-
 	p_cfi->cfiq->P_ID = jedec_table[index].CmdSet;
 	p_cfi->cfiq->NumEraseRegions = jedec_table[index].NumEraseRegions;
 	p_cfi->cfiq->DevSize = jedec_table[index].DevSize;

--
thanks
surya.

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

only message in thread, other threads:[~2007-08-13 13:37 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:52 [KJ] replacing kmalloc with kzalloc in drivers/mtd/chips/jedec_probe.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®