Messages in this thread Patch in this message |  | | Date | Sat, 22 Apr 2017 12:40:33 +0200 | From | Pavel Machek <> | 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@denx.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 [unhandled content-type:application/pgp-signature] |  |