mtd: remove printk's for [kv][mz]alloc failures
When a memory allocation fails, the kernel will print out a backtrace automatically. These print statements are unnecessary. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
parent
9616605607
commit
0870066d7e
@ -188,10 +188,7 @@ static struct mtd_partition * newpart(char *s,
|
|||||||
extra_mem_size;
|
extra_mem_size;
|
||||||
parts = kzalloc(alloc_size, GFP_KERNEL);
|
parts = kzalloc(alloc_size, GFP_KERNEL);
|
||||||
if (!parts)
|
if (!parts)
|
||||||
{
|
|
||||||
printk(KERN_ERR ERRP "out of memory\n");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
extra_mem = (unsigned char *)(parts + *num_parts);
|
extra_mem = (unsigned char *)(parts + *num_parts);
|
||||||
}
|
}
|
||||||
/* enter this partition (offset will be calculated later if it is zero at this point) */
|
/* enter this partition (offset will be calculated later if it is zero at this point) */
|
||||||
|
@ -67,10 +67,8 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
|||||||
|
|
||||||
inftl = kzalloc(sizeof(*inftl), GFP_KERNEL);
|
inftl = kzalloc(sizeof(*inftl), GFP_KERNEL);
|
||||||
|
|
||||||
if (!inftl) {
|
if (!inftl)
|
||||||
printk(KERN_WARNING "INFTL: Out of memory for data structures\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
inftl->mbd.mtd = mtd;
|
inftl->mbd.mtd = mtd;
|
||||||
inftl->mbd.devnum = -1;
|
inftl->mbd.devnum = -1;
|
||||||
|
@ -1121,10 +1121,8 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
|
|||||||
* table.
|
* table.
|
||||||
*/
|
*/
|
||||||
this->bbt = kzalloc(len, GFP_KERNEL);
|
this->bbt = kzalloc(len, GFP_KERNEL);
|
||||||
if (!this->bbt) {
|
if (!this->bbt)
|
||||||
printk(KERN_ERR "nand_scan_bbt: Out of memory\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If no primary table decriptor is given, scan the device to build a
|
* If no primary table decriptor is given, scan the device to build a
|
||||||
@ -1146,7 +1144,6 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
|
|||||||
len += (len >> this->page_shift) * mtd->oobsize;
|
len += (len >> this->page_shift) * mtd->oobsize;
|
||||||
buf = vmalloc(len);
|
buf = vmalloc(len);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk(KERN_ERR "nand_bbt: Out of memory\n");
|
|
||||||
kfree(this->bbt);
|
kfree(this->bbt);
|
||||||
this->bbt = NULL;
|
this->bbt = NULL;
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -1195,10 +1192,8 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
|
|||||||
len = (1 << this->bbt_erase_shift);
|
len = (1 << this->bbt_erase_shift);
|
||||||
len += (len >> this->page_shift) * mtd->oobsize;
|
len += (len >> this->page_shift) * mtd->oobsize;
|
||||||
buf = kmalloc(len, GFP_KERNEL);
|
buf = kmalloc(len, GFP_KERNEL);
|
||||||
if (!buf) {
|
if (!buf)
|
||||||
printk(KERN_ERR "nand_update_bbt: Out of memory\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
writeops = md != NULL ? 0x03 : 0x01;
|
writeops = md != NULL ? 0x03 : 0x01;
|
||||||
|
|
||||||
@ -1307,10 +1302,8 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
bd = kzalloc(sizeof(*bd), GFP_KERNEL);
|
bd = kzalloc(sizeof(*bd), GFP_KERNEL);
|
||||||
if (!bd) {
|
if (!bd)
|
||||||
printk(KERN_ERR "nand_create_default_bbt_descr: Out of memory\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
bd->options = this->bbt_options;
|
bd->options = this->bbt_options;
|
||||||
bd->offs = this->badblockpos;
|
bd->offs = this->badblockpos;
|
||||||
bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1;
|
bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1;
|
||||||
|
@ -444,7 +444,6 @@ static int rtc_from4_errstat(struct mtd_info *mtd, struct nand_chip *this,
|
|||||||
len = mtd->writesize;
|
len = mtd->writesize;
|
||||||
buf = kmalloc(len, GFP_KERNEL);
|
buf = kmalloc(len, GFP_KERNEL);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk(KERN_ERR "rtc_from4_errstat: Out of memory!\n");
|
|
||||||
er_stat = 1;
|
er_stat = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -67,10 +67,8 @@ static void nftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
|||||||
|
|
||||||
nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
|
nftl = kzalloc(sizeof(struct NFTLrecord), GFP_KERNEL);
|
||||||
|
|
||||||
if (!nftl) {
|
if (!nftl)
|
||||||
printk(KERN_WARNING "NFTL: out of memory for data structures\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
nftl->mbd.mtd = mtd;
|
nftl->mbd.mtd = mtd;
|
||||||
nftl->mbd.devnum = -1;
|
nftl->mbd.devnum = -1;
|
||||||
|
@ -188,10 +188,8 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
|
|||||||
len = this->chipsize >> (this->erase_shift + 2);
|
len = this->chipsize >> (this->erase_shift + 2);
|
||||||
/* Allocate memory (2bit per block) and clear the memory bad block table */
|
/* Allocate memory (2bit per block) and clear the memory bad block table */
|
||||||
bbm->bbt = kzalloc(len, GFP_KERNEL);
|
bbm->bbt = kzalloc(len, GFP_KERNEL);
|
||||||
if (!bbm->bbt) {
|
if (!bbm->bbt)
|
||||||
printk(KERN_ERR "onenand_scan_bbt: Out of memory\n");
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the bad block position */
|
/* Set the bad block position */
|
||||||
bbm->badblockpos = ONENAND_BADBLOCK_POS;
|
bbm->badblockpos = ONENAND_BADBLOCK_POS;
|
||||||
|
@ -304,11 +304,8 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL);
|
ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL);
|
||||||
if (!ssfdc) {
|
if (!ssfdc)
|
||||||
printk(KERN_WARNING
|
|
||||||
"SSFDC_RO: out of memory for data structures\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
ssfdc->mbd.mtd = mtd;
|
ssfdc->mbd.mtd = mtd;
|
||||||
ssfdc->mbd.devnum = -1;
|
ssfdc->mbd.devnum = -1;
|
||||||
@ -342,11 +339,8 @@ static void ssfdcr_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
|
|||||||
/* Allocate logical block map */
|
/* Allocate logical block map */
|
||||||
ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) *
|
ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) *
|
||||||
ssfdc->map_len, GFP_KERNEL);
|
ssfdc->map_len, GFP_KERNEL);
|
||||||
if (!ssfdc->logic_block_map) {
|
if (!ssfdc->logic_block_map)
|
||||||
printk(KERN_WARNING
|
|
||||||
"SSFDC_RO: out of memory for data structures\n");
|
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
|
||||||
memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) *
|
memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) *
|
||||||
ssfdc->map_len);
|
ssfdc->map_len);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user