cfi_probe.c-kzalloc
Subsystems (2)
PATCH 1/1 cfi_probe.c-kzalloc
Replacing kmalloc/memset combination with kzalloc.
Signed-off-by vignesh babu <[email protected]>
---
drivers/mtd/chips/cfi_probe.c +1 -3
@@ -203,14 +203,12 @@ static int __xipram cfi_chip_setup(struct map_info *map,if (!num_erase_regions)return 0 ; - cfi->cfiq =kmalloc (sizeof (struct cfi_ident ) + num_erase_regions *4 ,GFP_KERNEL ); + cfi->cfiq =kzalloc (sizeof (struct cfi_ident ) + num_erase_regions *4 ,GFP_KERNEL );if (!cfi->cfiq) {printk (KERN_WARNING "%s: kmalloc failed for CFI ident structure\n" , map->name);return 0 ; } -memset (cfi->cfiq,0 ,sizeof (struct cfi_ident )); - cfi->cfi_mode =CFI_MODE_CFI ;/* Read the CFI info structure */
drivers/mtd/chips/jedec_probe.c +1 -3
@@ -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;
drivers/mtd/devices/docprobe.c +1 -4
@@ -257,7 +257,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" );
@@ -267,9 +267,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;
Signature · 4 lines
Regards, Vignesh Babu BM _____________________________________________________________ "Why is it that every time I'm with you, makes me believe in magic?"
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors