[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170422104033.GA14508@amd>
Date: Sat, 22 Apr 2017 12:40:33 +0200
From: Pavel Machek <pavel@....cz>
To: Boris Brezillon <boris.brezillon@...e-electrons.com>,
marc_gonzalez@...madesigns.com
Cc: Dipen.Dudhat@...escale.com, richard@....at, dwmw2@...radead.org,
computersforpeace@...il.com, marek.vasut@...il.com,
cyrille.pitchen@...el.com, linux-mtd@...ts.infradead.org,
linux-kernel@...r.kernel.org, mark.marshall@...cronenergy.com,
b44839@...escale.com, prabhakar@...escale.com
Subject: [PATCH] tango_nand.c: fix ecc.stats_corrected in empty flash case
Fix ecc.stats_corrected in empty flash case.
Signed-off-by: Pavel Machek <pavel@...x.de>
---
This was suggested by Boris Brezillon in another context. Not tested;
I don't have the hardware.
diff --git a/drivers/mtd/nand/tango_nand.c b/drivers/mtd/nand/tango_nand.c
index 4a5e948..db4bff4 100644
--- a/drivers/mtd/nand/tango_nand.c
+++ b/drivers/mtd/nand/tango_nand.c
@@ -193,6 +193,8 @@ static int check_erased_page(struct nand_chip *chip, u8 *buf)
chip->ecc.strength);
if (res < 0)
mtd->ecc_stats.failed++;
+ else
+ mtd->ecc_stats.corrected += res;
bitflips = max(res, bitflips);
buf += pkt_size;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists