public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Nicholas Krause <xerofoify@gmail.com>
To: dwmw2@infradead.org
Cc: boris.brezillon@free-electrons.com, baruch@tkos.co.il,
	kdasu.kdev@gmail.com, zajec5@gmail.com, bpqw@micron.com,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	ezequiel.garcia@free-electrons.com, asierra@xes-inc.com,
	computersforpeace@gmail.com, rogerq@ti.com
Subject: [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail
Date: Sat,  2 May 2015 11:10:13 -0400	[thread overview]
Message-ID: <1430579413-4820-1-git-send-email-xerofoify@gmail.com> (raw)

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

             reply	other threads:[~2015-05-02 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-02 15:10 Nicholas Krause [this message]
2015-05-02 15:57 ` [PATCH] mtd:Remove unnessary BUG function calls in nand_scan_tail Richard Weinberger
2015-05-02 16:36   ` Nicholas Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430579413-4820-1-git-send-email-xerofoify@gmail.com \
    --to=xerofoify@gmail.com \
    --cc=asierra@xes-inc.com \
    --cc=baruch@tkos.co.il \
    --cc=boris.brezillon@free-electrons.com \
    --cc=bpqw@micron.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=ezequiel.garcia@free-electrons.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rogerq@ti.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox