mtd:Remove unnessary BUG function calls in nand_scan_tail
Subsystems (2)
PATCH 1/1 mtd:Remove unnessary BUG function calls in nand_scan_tail
This removes all unnessary calls to BUG() below pr_warn print messages as these printed messages are verbose enough for debugging if these scenarios are hit in the function,nand_scan_tail.
--- drivers/mtd/nand/nand_base.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/mtd/nand/nand_base.c +0 -8
@@ -3949,7 +3949,6 @@ int nand_scan_tail(struct mtd_info *mtd)default :pr_warn ("No oob scheme defined for oobsize %d\n" , mtd->oobsize); -BUG (); } }
@@ -3966,7 +3965,6 @@ int nand_scan_tail(struct mtd_info *mtd)/* Similar to NAND_ECC_HW, but a separate read_page handle */ if (!ecc->calculate || !ecc->correct || !ecc->hwctl) {pr_warn ("No ECC functions supplied; hardware ECC not possible\n" ); -BUG (); }if (!ecc->read_page) ecc->read_page = nand_read_page_hwecc_oob_first;
@@ -3997,7 +3995,6 @@ int nand_scan_tail(struct mtd_info *mtd) !ecc->write_page || ecc->write_page == nand_write_page_hwecc)) {pr_warn ("No ECC functions supplied; hardware ECC not possible\n" ); -BUG (); }/* Use standard syndrome read/write page function? */ if (!ecc->read_page)
@@ -4016,7 +4013,6 @@ int nand_scan_tail(struct mtd_info *mtd)if (mtd->writesize >= ecc->size) {if (!ecc->strength) {pr_warn ("Driver must set ecc.strength when using hardware ECC\n" ); -BUG (); }break ; }
@@ -4043,7 +4039,6 @@ int nand_scan_tail(struct mtd_info *mtd)case NAND_ECC_SOFT_BCH :if (!mtd_nand_has_bch ()) {pr_warn ("CONFIG_MTD_NAND_ECC_BCH not enabled\n" ); -BUG (); } ecc->calculate = nand_bch_calculate_ecc; ecc->correct = nand_bch_correct_data;
@@ -4071,7 +4066,6 @@ int nand_scan_tail(struct mtd_info *mtd) &ecc->layout);if (!ecc->priv) {pr_warn ("BCH ECC initialization failed!\n" ); -BUG (); }break ;
@@ -4090,7 +4084,6 @@ int nand_scan_tail(struct mtd_info *mtd)default :pr_warn ("Invalid NAND_ECC_MODE %d\n" , ecc->mode); -BUG (); }/* For many systems, the standard OOB write also works for raw */
@@ -4121,7 +4114,6 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->steps = mtd->writesize / ecc->size;if (ecc->steps * ecc->size != mtd->writesize) {pr_warn ("Invalid ECC parameters\n" ); -BUG (); } ecc->total = ecc->steps * ecc->bytes;
Signature · 1 line
2.1.4
Quoted 3 lines · Nicholas Krause
This removes all unnessary calls to
BUG()belowpr_warnprint messages as these printed messages are verbose enough for debugging if these scenarios are hit in the function,nand_scan_tail.
NAK.
We cannot continue with a bad ECC mode.
Signature · 2 lines
Thanks, //richard
Quoted 9 lines · Richard Weinberger
Quoted 1 line · Nicholas Krause
This removes all unnessary calls to
BUG()belowpr_warnprintmessages
Quoted 2 lines
as these printed messages are verbose enough for debugging if these scenarios are hit in the function,nand_scan_tail.
NAK.
We cannot continue with a bad ECC mode.
That makes sense, clearly you are correct here.
Nick
Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.