提交 d0370219 编写于 作者: B Brian Norris 提交者: Artem Bityutskiy

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: NBrian Norris <computersforpeace@gmail.com>
Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@intel.com>
上级 9a4d4d69
...@@ -2179,8 +2179,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to, ...@@ -2179,8 +2179,8 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
/* Reject writes, which are not page aligned */ /* Reject writes, which are not page aligned */
if (NOTALIGNED(to) || NOTALIGNED(ops->len)) { if (NOTALIGNED(to) || NOTALIGNED(ops->len)) {
pr_notice("%s: Attempt to write not " pr_notice("%s: attempt to write non page aligned data\n",
"page aligned data\n", __func__); __func__);
return -EINVAL; return -EINVAL;
} }
...@@ -2570,8 +2570,8 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, ...@@ -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! */ /* Heck if we have a bad block, we do not erase bad blocks! */
if (nand_block_checkbad(mtd, ((loff_t) page) << if (nand_block_checkbad(mtd, ((loff_t) page) <<
chip->page_shift, 0, allowbbt)) { chip->page_shift, 0, allowbbt)) {
pr_warn("%s: attempt to erase a bad block " pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
"at page 0x%08x\n", __func__, page); __func__, page);
instr->state = MTD_ERASE_FAILED; instr->state = MTD_ERASE_FAILED;
goto erase_exit; goto erase_exit;
} }
...@@ -2744,8 +2744,8 @@ static void nand_resume(struct mtd_info *mtd) ...@@ -2744,8 +2744,8 @@ static void nand_resume(struct mtd_info *mtd)
if (chip->state == FL_PM_SUSPENDED) if (chip->state == FL_PM_SUSPENDED)
nand_release_device(mtd); nand_release_device(mtd);
else else
pr_err("%s called for a chip which is not " pr_err("%s called for a chip which is not in suspended state\n",
"in suspended state\n", __func__); __func__);
} }
/* Set default functions */ /* Set default functions */
...@@ -2866,8 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip, ...@@ -2866,8 +2866,7 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
chip->onfi_version = 0; chip->onfi_version = 0;
if (!chip->onfi_version) { if (!chip->onfi_version) {
pr_info("%s: unsupported ONFI version: %d\n", pr_info("%s: unsupported ONFI version: %d\n", __func__, val);
__func__, val);
return 0; return 0;
} }
...@@ -3175,7 +3174,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, ...@@ -3175,7 +3174,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips,
if (IS_ERR(type)) { if (IS_ERR(type)) {
if (!(chip->options & NAND_SCAN_SILENT_NODEV)) 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); chip->select_chip(mtd, -1);
return PTR_ERR(type); return PTR_ERR(type);
} }
...@@ -3243,8 +3242,8 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3243,8 +3242,8 @@ int nand_scan_tail(struct mtd_info *mtd)
chip->ecc.layout = &nand_oob_128; chip->ecc.layout = &nand_oob_128;
break; break;
default: default:
pr_warn("No oob scheme defined for " pr_warn("No oob scheme defined for oobsize %d\n",
"oobsize %d\n", mtd->oobsize); mtd->oobsize);
BUG(); BUG();
} }
} }
...@@ -3263,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3263,7 +3262,7 @@ int nand_scan_tail(struct mtd_info *mtd)
if (!chip->ecc.calculate || !chip->ecc.correct || if (!chip->ecc.calculate || !chip->ecc.correct ||
!chip->ecc.hwctl) { !chip->ecc.hwctl) {
pr_warn("No ECC functions supplied; " pr_warn("No ECC functions supplied; "
"Hardware ECC not possible\n"); "hardware ECC not possible\n");
BUG(); BUG();
} }
if (!chip->ecc.read_page) if (!chip->ecc.read_page)
...@@ -3292,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3292,7 +3291,7 @@ int nand_scan_tail(struct mtd_info *mtd)
!chip->ecc.write_page || !chip->ecc.write_page ||
chip->ecc.write_page == nand_write_page_hwecc)) { chip->ecc.write_page == nand_write_page_hwecc)) {
pr_warn("No ECC functions supplied; " pr_warn("No ECC functions supplied; "
"Hardware ECC not possible\n"); "hardware ECC not possible\n");
BUG(); BUG();
} }
/* Use standard syndrome read/write page function? */ /* Use standard syndrome read/write page function? */
...@@ -3367,7 +3366,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3367,7 +3366,7 @@ int nand_scan_tail(struct mtd_info *mtd)
case NAND_ECC_NONE: case NAND_ECC_NONE:
pr_warn("NAND_ECC_NONE selected by board driver. " 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.read_page = nand_read_page_raw;
chip->ecc.write_page = nand_write_page_raw; chip->ecc.write_page = nand_write_page_raw;
chip->ecc.read_oob = nand_read_oob_std; chip->ecc.read_oob = nand_read_oob_std;
...@@ -3379,8 +3378,7 @@ int nand_scan_tail(struct mtd_info *mtd) ...@@ -3379,8 +3378,7 @@ int nand_scan_tail(struct mtd_info *mtd)
break; break;
default: default:
pr_warn("Invalid NAND_ECC_MODE %d\n", pr_warn("Invalid NAND_ECC_MODE %d\n", chip->ecc.mode);
chip->ecc.mode);
BUG(); BUG();
} }
...@@ -3492,8 +3490,7 @@ int nand_scan(struct mtd_info *mtd, int maxchips) ...@@ -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... */ /* Many callers got this wrong, so check for it for a while... */
if (!mtd->owner && caller_is_module()) { if (!mtd->owner && caller_is_module()) {
pr_crit("%s called with NULL mtd->owner!\n", pr_crit("%s called with NULL mtd->owner!\n", __func__);
__func__);
BUG(); BUG();
} }
......
...@@ -205,7 +205,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, ...@@ -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); res = mtd->read(mtd, from, len, &retlen, buf);
if (res < 0) { if (res < 0) {
if (retlen != len) { 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; return res;
} }
pr_warn("nand_bbt: ECC error while reading bad block table\n"); 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, ...@@ -219,7 +219,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num,
if (tmp == msk) if (tmp == msk)
continue; continue;
if (reserved_block_code && (tmp == reserved_block_code)) { 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); (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06); this->bbt[offs + (act >> 3)] |= 0x2 << (act & 0x06);
mtd->ecc_stats.bbtblocks++; mtd->ecc_stats.bbtblocks++;
...@@ -229,7 +229,7 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, ...@@ -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 * Leave it for now, if it's matured we can
* move this message to pr_debug. * 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); (loff_t)((offs << 2) + (act >> 1)) << this->bbt_erase_shift);
/* Factory marked bad or worn out? */ /* Factory marked bad or worn out? */
if (tmp == 0) if (tmp == 0)
...@@ -616,8 +616,8 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr ...@@ -616,8 +616,8 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr
if (td->pages[i] == -1) if (td->pages[i] == -1)
pr_warn("Bad block table not found for chip %d\n", i); pr_warn("Bad block table not found for chip %d\n", i);
else else
pr_info("Bad block table found at page %d, version 0x%02X\n", td->pages[i], pr_info("Bad block table found at page %d, version "
td->version[i]); "0x%02X\n", td->pages[i], td->version[i]);
} }
return 0; return 0;
} }
...@@ -765,14 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -765,14 +765,12 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
res = mtd->read(mtd, to, len, &retlen, buf); res = mtd->read(mtd, to, len, &retlen, buf);
if (res < 0) { if (res < 0) {
if (retlen != len) { if (retlen != len) {
pr_info("nand_bbt: Error " pr_info("nand_bbt: error reading block "
"reading block for writing " "for writing the bad block table\n");
"the bad block table\n");
return res; return res;
} }
pr_warn("nand_bbt: ECC error " pr_warn("nand_bbt: ECC error while reading "
"while reading block for writing " "block for writing bad block table\n");
"bad block table\n");
} }
/* Read oob data */ /* Read oob data */
ops.ooblen = (len >> this->page_shift) * mtd->oobsize; ops.ooblen = (len >> this->page_shift) * mtd->oobsize;
...@@ -847,8 +845,8 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -847,8 +845,8 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
if (res < 0) if (res < 0)
goto outerr; goto outerr;
pr_info("Bad block table written to 0x%012llx, version " pr_info("Bad block table written to 0x%012llx, version 0x%02X\n",
"0x%02X\n", (unsigned long long)to, td->version[chip]); (unsigned long long)to, td->version[chip]);
/* Mark it as used */ /* Mark it as used */
td->pages[chip] = page; td->pages[chip] = page;
...@@ -856,8 +854,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, ...@@ -856,8 +854,7 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf,
return 0; return 0;
outerr: outerr:
printk(KERN_WARNING pr_warn("nand_bbt: error while writing bad block table %d\n", res);
"nand_bbt: Error while writing bad block table %d\n", res);
return res; return res;
} }
...@@ -1137,7 +1134,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) ...@@ -1137,7 +1134,7 @@ int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd)
*/ */
if (!td) { if (!td) {
if ((res = nand_memory_bbt(mtd, bd))) { 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); kfree(this->bbt);
this->bbt = NULL; this->bbt = NULL;
} }
...@@ -1305,7 +1302,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this) ...@@ -1305,7 +1302,7 @@ static int nand_create_default_bbt_descr(struct nand_chip *this)
{ {
struct nand_bbt_descr *bd; struct nand_bbt_descr *bd;
if (this->badblock_pattern) { if (this->badblock_pattern) {
pr_warn("BBT descr already allocated; not replacing.\n"); pr_warn("BBT descr already allocated; not replacing\n");
return -EINVAL; return -EINVAL;
} }
bd = kzalloc(sizeof(*bd), GFP_KERNEL); bd = kzalloc(sizeof(*bd), GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册