Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0870066d authored by Brian Norris's avatar Brian Norris Committed by Artem Bityutskiy
Browse files

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: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 96166056
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -188,10 +188,7 @@ static struct mtd_partition * newpart(char *s,
			     extra_mem_size;
		parts = kzalloc(alloc_size, GFP_KERNEL);
		if (!parts)
		{
			printk(KERN_ERR ERRP "out of memory\n");
			return NULL;
		}
		extra_mem = (unsigned char *)(parts + *num_parts);
	}
	/* enter this partition (offset will be calculated later if it is zero at this point) */
+1 −3
Original line number Diff line number Diff line
@@ -67,10 +67,8 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)

	inftl = kzalloc(sizeof(*inftl), GFP_KERNEL);

	if (!inftl) {
		printk(KERN_WARNING "INFTL: Out of memory for data structures\n");
	if (!inftl)
		return;
	}

	inftl->mbd.mtd = mtd;
	inftl->mbd.devnum = -1;
+3 −10
Original line number Diff line number Diff line
@@ -1121,10 +1121,8 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
	 * table.
	 */
	this->bbt = kzalloc(len, GFP_KERNEL);
	if (!this->bbt) {
		printk(KERN_ERR "nand_scan_bbt: Out of memory\n");
	if (!this->bbt)
		return -ENOMEM;
	}

	/*
	 * 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;
	buf = vmalloc(len);
	if (!buf) {
		printk(KERN_ERR "nand_bbt: Out of memory\n");
		kfree(this->bbt);
		this->bbt = NULL;
		return -ENOMEM;
@@ -1195,10 +1192,8 @@ int nand_update_bbt(struct mtd_info *mtd, loff_t offs)
	len = (1 << this->bbt_erase_shift);
	len += (len >> this->page_shift) * mtd->oobsize;
	buf = kmalloc(len, GFP_KERNEL);
	if (!buf) {
		printk(KERN_ERR "nand_update_bbt: Out of memory\n");
	if (!buf)
		return -ENOMEM;
	}

	writeops = md != NULL ? 0x03 : 0x01;

@@ -1307,10 +1302,8 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
		return -EINVAL;
	}
	bd = kzalloc(sizeof(*bd), GFP_KERNEL);
	if (!bd) {
		printk(KERN_ERR "nand_create_default_bbt_descr: Out of memory\n");
	if (!bd)
		return -ENOMEM;
	}
	bd->options = this->bbt_options;
	bd->offs = this->badblockpos;
	bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1;
+0 −1
Original line number Diff line number Diff line
@@ -444,7 +444,6 @@ static int rtc_from4_errstat(struct mtd_info *mtd, struct nand_chip *this,
		len = mtd->writesize;
		buf = kmalloc(len, GFP_KERNEL);
		if (!buf) {
			printk(KERN_ERR "rtc_from4_errstat: Out of memory!\n");
			er_stat = 1;
			goto out;
		}
+1 −3
Original line number Diff line number Diff line
@@ -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);

	if (!nftl) {
		printk(KERN_WARNING "NFTL: out of memory for data structures\n");
	if (!nftl)
		return;
	}

	nftl->mbd.mtd = mtd;
	nftl->mbd.devnum = -1;
Loading