public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail
@ 2015-05-02 15:10 Nicholas Krause
  2015-05-02 15:57 ` Richard Weinberger
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Krause @ 2015-05-02 15:10 UTC (permalink / raw)
  To: dwmw2
  Cc: boris.brezillon, baruch, kdasu.kdev, zajec5, bpqw, linux-kernel,
	linux-mtd, ezequiel.garcia, asierra, computersforpeace, rogerq

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.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 drivers/mtd/nand/nand_base.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index c2e1232..6a5bc99 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -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;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail
  2015-05-02 15:10 [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail Nicholas Krause
@ 2015-05-02 15:57 ` Richard Weinberger
  2015-05-02 16:36   ` Nicholas Krause
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2015-05-02 15:57 UTC (permalink / raw)
  To: Nicholas Krause
  Cc: boris.brezillon, Baruch Siach, kdasu.kdev,
	Rafał Miłecki, bpqw, LKML,
	linux-mtd@lists.infradead.org, Ezequiel Garcia, asierra,
	Brian Norris, David Woodhouse, rogerq

On Sat, May 2, 2015 at 5:10 PM, Nicholas Krause <xerofoify@gmail.com> wrote:
> 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.

NAK.
We cannot continue with a bad ECC mode.

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail
  2015-05-02 15:57 ` Richard Weinberger
@ 2015-05-02 16:36   ` Nicholas Krause
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Krause @ 2015-05-02 16:36 UTC (permalink / raw)
  To: Richard Weinberger
  Cc: boris.brezillon, Baruch Siach, kdasu.kdev,
	Rafał Miłecki, bpqw, LKML,
	linux-mtd@lists.infradead.org, Ezequiel Garcia, asierra,
	Brian Norris, David Woodhouse, rogerq



On May 2, 2015 11:57:28 AM EDT, Richard Weinberger <richard.weinberger@gmail.com> wrote:
>On Sat, May 2, 2015 at 5:10 PM, Nicholas Krause <xerofoify@gmail.com>
>wrote:
>> 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.
>
>NAK.
>We cannot continue with a bad ECC mode.
That makes sense, clearly you are correct here. 
Nick
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-02 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-02 15:10 [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail Nicholas Krause
2015-05-02 15:57 ` Richard Weinberger
2015-05-02 16:36   ` Nicholas Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox