diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2014-08-19 07:55:34 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-09-18 02:29:36 -0400 |
commit | 2ac63d901b1170fba509ae135d5f5f4472b84819 (patch) | |
tree | 592c88661f39dc4f66fa09d7fbdb5c9af9de00f8 | |
parent | b7ab610f628a381a1029d214476742d8589f1e02 (diff) |
mtd: nand: don't break long print messages
This follows Chapter 2 of Linux's CodingStyle:
> However, never break user-visible strings such as printk messages,
> because that breaks the ability to grep for them.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 14 | ||||
-rw-r--r-- | drivers/mtd/nand/nand_bbt.c | 23 |
2 files changed, 15 insertions, 22 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index ae6e7c47f8e2..801cad1de9eb 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -3936,8 +3936,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3936 | case NAND_ECC_HW_OOB_FIRST: | 3936 | case NAND_ECC_HW_OOB_FIRST: |
3937 | /* Similar to NAND_ECC_HW, but a separate read_page handle */ | 3937 | /* Similar to NAND_ECC_HW, but a separate read_page handle */ |
3938 | if (!ecc->calculate || !ecc->correct || !ecc->hwctl) { | 3938 | if (!ecc->calculate || !ecc->correct || !ecc->hwctl) { |
3939 | pr_warn("No ECC functions supplied; " | 3939 | pr_warn("No ECC functions supplied; hardware ECC not possible\n"); |
3940 | "hardware ECC not possible\n"); | ||
3941 | BUG(); | 3940 | BUG(); |
3942 | } | 3941 | } |
3943 | if (!ecc->read_page) | 3942 | if (!ecc->read_page) |
@@ -3968,8 +3967,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3968 | ecc->read_page == nand_read_page_hwecc || | 3967 | ecc->read_page == nand_read_page_hwecc || |
3969 | !ecc->write_page || | 3968 | !ecc->write_page || |
3970 | ecc->write_page == nand_write_page_hwecc)) { | 3969 | ecc->write_page == nand_write_page_hwecc)) { |
3971 | pr_warn("No ECC functions supplied; " | 3970 | pr_warn("No ECC functions supplied; hardware ECC not possible\n"); |
3972 | "hardware ECC not possible\n"); | ||
3973 | BUG(); | 3971 | BUG(); |
3974 | } | 3972 | } |
3975 | /* Use standard syndrome read/write page function? */ | 3973 | /* Use standard syndrome read/write page function? */ |
@@ -3993,9 +3991,8 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
3993 | } | 3991 | } |
3994 | break; | 3992 | break; |
3995 | } | 3993 | } |
3996 | pr_warn("%d byte HW ECC not possible on " | 3994 | pr_warn("%d byte HW ECC not possible on %d byte page size, fallback to SW ECC\n", |
3997 | "%d byte page size, fallback to SW ECC\n", | 3995 | ecc->size, mtd->writesize); |
3998 | ecc->size, mtd->writesize); | ||
3999 | ecc->mode = NAND_ECC_SOFT; | 3996 | ecc->mode = NAND_ECC_SOFT; |
4000 | 3997 | ||
4001 | case NAND_ECC_SOFT: | 3998 | case NAND_ECC_SOFT: |
@@ -4048,8 +4045,7 @@ int nand_scan_tail(struct mtd_info *mtd) | |||
4048 | break; | 4045 | break; |
4049 | 4046 | ||
4050 | case NAND_ECC_NONE: | 4047 | case NAND_ECC_NONE: |
4051 | pr_warn("NAND_ECC_NONE selected by board driver. " | 4048 | pr_warn("NAND_ECC_NONE selected by board driver. This is not recommended!\n"); |
4052 | "This is not recommended!\n"); | ||
4053 | ecc->read_page = nand_read_page_raw; | 4049 | ecc->read_page = nand_read_page_raw; |
4054 | ecc->write_page = nand_write_page_raw; | 4050 | ecc->write_page = nand_write_page_raw; |
4055 | ecc->read_oob = nand_read_oob_std; | 4051 | ecc->read_oob = nand_read_oob_std; |
diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 443fa82cde6a..9bb8453d224e 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c | |||
@@ -201,12 +201,12 @@ static int read_bbt(struct mtd_info *mtd, uint8_t *buf, int page, int num, | |||
201 | res = mtd_read(mtd, from, len, &retlen, buf); | 201 | res = mtd_read(mtd, from, len, &retlen, buf); |
202 | if (res < 0) { | 202 | if (res < 0) { |
203 | if (mtd_is_eccerr(res)) { | 203 | if (mtd_is_eccerr(res)) { |
204 | pr_info("nand_bbt: ECC error in BBT at " | 204 | pr_info("nand_bbt: ECC error in BBT at 0x%012llx\n", |
205 | "0x%012llx\n", from & ~mtd->writesize); | 205 | from & ~mtd->writesize); |
206 | return res; | 206 | return res; |
207 | } else if (mtd_is_bitflip(res)) { | 207 | } else if (mtd_is_bitflip(res)) { |
208 | pr_info("nand_bbt: corrected error in BBT at " | 208 | pr_info("nand_bbt: corrected error in BBT at 0x%012llx\n", |
209 | "0x%012llx\n", from & ~mtd->writesize); | 209 | from & ~mtd->writesize); |
210 | ret = res; | 210 | ret = res; |
211 | } else { | 211 | } else { |
212 | pr_info("nand_bbt: error reading BBT\n"); | 212 | pr_info("nand_bbt: error reading BBT\n"); |
@@ -580,8 +580,8 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr | |||
580 | if (td->pages[i] == -1) | 580 | if (td->pages[i] == -1) |
581 | pr_warn("Bad block table not found for chip %d\n", i); | 581 | pr_warn("Bad block table not found for chip %d\n", i); |
582 | else | 582 | else |
583 | pr_info("Bad block table found at page %d, version " | 583 | pr_info("Bad block table found at page %d, version 0x%02X\n", |
584 | "0x%02X\n", td->pages[i], td->version[i]); | 584 | td->pages[i], td->version[i]); |
585 | } | 585 | } |
586 | return 0; | 586 | return 0; |
587 | } | 587 | } |
@@ -725,12 +725,10 @@ static int write_bbt(struct mtd_info *mtd, uint8_t *buf, | |||
725 | res = mtd_read(mtd, to, len, &retlen, buf); | 725 | res = mtd_read(mtd, to, len, &retlen, buf); |
726 | if (res < 0) { | 726 | if (res < 0) { |
727 | if (retlen != len) { | 727 | if (retlen != len) { |
728 | pr_info("nand_bbt: error reading block " | 728 | pr_info("nand_bbt: error reading block for writing the bad block table\n"); |
729 | "for writing the bad block table\n"); | ||
730 | return res; | 729 | return res; |
731 | } | 730 | } |
732 | pr_warn("nand_bbt: ECC error while reading " | 731 | pr_warn("nand_bbt: ECC error while reading block for writing bad block table\n"); |
733 | "block for writing bad block table\n"); | ||
734 | } | 732 | } |
735 | /* Read oob data */ | 733 | /* Read oob data */ |
736 | ops.ooblen = (len >> this->page_shift) * mtd->oobsize; | 734 | ops.ooblen = (len >> this->page_shift) * mtd->oobsize; |
@@ -1338,9 +1336,8 @@ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) | |||
1338 | block = (int)(offs >> this->bbt_erase_shift); | 1336 | block = (int)(offs >> this->bbt_erase_shift); |
1339 | res = bbt_get_entry(this, block); | 1337 | res = bbt_get_entry(this, block); |
1340 | 1338 | ||
1341 | pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: " | 1339 | pr_debug("nand_isbad_bbt(): bbt info for offs 0x%08x: (block %d) 0x%02x\n", |
1342 | "(block %d) 0x%02x\n", | 1340 | (unsigned int)offs, block, res); |
1343 | (unsigned int)offs, block, res); | ||
1344 | 1341 | ||
1345 | switch (res) { | 1342 | switch (res) { |
1346 | case BBT_BLOCK_GOOD: | 1343 | case BBT_BLOCK_GOOD: |