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

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

mtd: nand: style fixups in pr_* messages



This is a cleanup of some punctuation, indentation, and capitalization
on the lines affected affected by the last patch.

Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@intel.com>
parent 9a4d4d69
Loading
Loading
Loading
Loading
+23 −26
Original line number Diff line number Diff line
@@ -2179,8 +2179,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,

	/* Reject writes, which are not page aligned */
	if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
		pr_notice("%s: Attempt to write not "
				"page aligned data\n", __func__);
		pr_notice("%s: attempt to write non page aligned data\n",
			   __func__);
		return -EINVAL;
	}

@@ -2570,8 +2570,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
		/* Heck if we have a bad block, we do not erase bad blocks! */
		if (nand_block_checkbad(mtd, ((loff_t) page) <<
					chip->page_shift, 0, allowbbt)) {
			pr_warn("%s: attempt to erase a bad block "
					"at page 0x%08x\n", __func__, page);
			pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
				    __func__, page);
			instr->state = MTD_ERASE_FAILED;
			goto erase_exit;
		}
@@ -2744,8 +2744,8 @@ static void nand_resume(struct mtd_info *mtd)
	if (chip->state == FL_PM_SUSPENDED)
		nand_release_device(mtd);
	else
		pr_err("%s called for a chip which is not "
		       "in suspended state\n", __func__);
		pr_err("%s called for a chip which is not in suspended state\n",
			__func__);
}

/* Set default functions */
@@ -2866,8 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
		chip->onfi_version = 0;

	if (!chip->onfi_version) {
		pr_info("%s: unsupported ONFI version: %d\n",
								__func__, val);
		pr_info("%s: unsupported ONFI version: %d\n", __func__, val);
		return 0;
	}

@@ -3175,7 +3174,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,

	if (IS_ERR(type)) {
		if (!(chip->options & NAND_SCAN_SILENT_NODEV))
			pr_warn("No NAND device found.\n");
			pr_warn("No NAND device found\n");
		chip->select_chip(mtd, -1);
		return PTR_ERR(type);
	}
@@ -3243,8 +3242,8 @@ int nand_scan_tail(struct mtd_info *mtd)
			chip->ecc.layout = &nand_oob_128;
			break;
		default:
			pr_warn("No oob scheme defined for "
			       "oobsize %d\n", mtd->oobsize);
			pr_warn("No oob scheme defined for oobsize %d\n",
				   mtd->oobsize);
			BUG();
		}
	}
@@ -3263,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd)
		if (!chip->ecc.calculate || !chip->ecc.correct ||
		     !chip->ecc.hwctl) {
			pr_warn("No ECC functions supplied; "
			       "Hardware ECC not possible\n");
				   "hardware ECC not possible\n");
			BUG();
		}
		if (!chip->ecc.read_page)
@@ -3292,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd)
		     !chip->ecc.write_page ||
		     chip->ecc.write_page == nand_write_page_hwecc)) {
			pr_warn("No ECC functions supplied; "
			       "Hardware ECC not possible\n");
				   "hardware ECC not possible\n");
			BUG();
		}
		/* Use standard syndrome read/write page function? */
@@ -3367,7 +3366,7 @@ int nand_scan_tail(struct mtd_info *mtd)

	case NAND_ECC_NONE:
		pr_warn("NAND_ECC_NONE selected by board driver. "
		       "This is not recommended !!\n");
			   "This is not recommended!\n");
		chip->ecc.read_page = nand_read_page_raw;
		chip->ecc.write_page = nand_write_page_raw;
		chip->ecc.read_oob = nand_read_oob_std;
@@ -3379,8 +3378,7 @@ int nand_scan_tail(struct mtd_info *mtd)
		break;

	default:
		pr_warn("Invalid NAND_ECC_MODE %d\n",
		       chip->ecc.mode);
		pr_warn("Invalid NAND_ECC_MODE %d\n", chip->ecc.mode);
		BUG();
	}

@@ -3492,8 +3490,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips)

	/* Many callers got this wrong, so check for it for a while... */
	if (!mtd->owner && caller_is_module()) {
		pr_crit("%s called with NULL mtd->owner!\n",
				__func__);
		pr_crit("%s called with NULL mtd->owner!\n", __func__);
		BUG();
	}

+19 −22
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
		res = mtd->read(mtd, from, len, &retlen, buf);
		if (res < 0) {
			if (retlen != len) {
				pr_info("nand_bbt: Error reading bad block table\n");
				pr_info("nand_bbt: error reading bad block table\n");
				return res;
			}
			pr_warn("nand_bbt: ECC error while reading bad block table\n");
@@ -219,7 +219,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
				if (tmp == msk)
					continue;
				if (reserved_block_code && (tmp == reserved_block_code)) {
					pr_info("nand_read_bbt: Reserved block at 0x%012llx\n",
					pr_info("nand_read_bbt: reserved block at 0x%012llx\n",
						 (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
					this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06);
					mtd->ecc_stats.bbtblocks++;
@@ -229,7 +229,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
				 * Leave it for now, if it's matured we can
				 * move this message to pr_debug.
				 */
				pr_info("nand_read_bbt: Bad block at 0x%012llx\n",
				pr_info("nand_read_bbt: bad block at 0x%012llx\n",
					 (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
				/* Factory marked bad or worn out? */
				if (tmp == 0)
@@ -616,8 +616,8 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
		if (td->pages[i] == -1)
			pr_warn("Bad block table not found for chip %d\n", i);
		else
			pr_info("Bad block table found at page %d, version 0x%02X\n", td->pages[i],
			       td->version[i]);
			pr_info("Bad block table found at page %d, version "
				 "0x%02X\n", td->pages[i], td->version[i]);
	}
	return 0;
}
@@ -765,14 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
			res = mtd->read(mtd, to, len, &retlen, buf);
			if (res < 0) {
				if (retlen != len) {
					pr_info("nand_bbt: Error "
					       "reading block for writing "
					       "the bad block table\n");
					pr_info("nand_bbt: error reading block "
						"for writing the bad block table\n");
					return res;
				}
				pr_warn("nand_bbt: ECC error "
				       "while reading block for writing "
				       "bad block table\n");
				pr_warn("nand_bbt: ECC error while reading "
					"block for writing bad block table\n");
			}
			/* Read oob data */
			ops.ooblen = (len >> this->page_shift) * mtd->oobsize;
@@ -847,8 +845,8 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
		if (res < 0)
			goto outerr;

		pr_info("Bad block table written to 0x%012llx, version "
		       "0x%02X\n", (unsigned long long)to, td->version[chip]);
		pr_info("Bad block table written to 0x%012llx, version 0x%02X\n",
			 (unsigned long long)to, td->version[chip]);

		/* Mark it as used */
		td->pages[chip] = page;
@@ -856,8 +854,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
	return 0;

 outerr:
	printk(KERN_WARNING
	       "nand_bbt: Error while writing bad block table %d\n", res);
	pr_warn("nand_bbt: error while writing bad block table %d\n", res);
	return res;
}

@@ -1137,7 +1134,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
	 */
	if (!td) {
		if ((res = nand_memory_bbt(mtd, bd))) {
			pr_err("nand_bbt: Can't scan flash and build the RAM-based BBT\n");
			pr_err("nand_bbt: can't scan flash and build the RAM-based BBT\n");
			kfree(this->bbt);
			this->bbt = NULL;
		}
@@ -1305,7 +1302,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
{
	struct nand_bbt_descr *bd;
	if (this->badblock_pattern) {
		pr_warn("BBT descr already allocated; not replacing.\n");
		pr_warn("BBT descr already allocated; not replacing\n");
		return -EINVAL;
	}
	bd = kzalloc(sizeof(*bd), GFP_KERNEL);