From 73c6c15a4f10f9fd437d28a7de9dc90a6ed97826 Mon Sep 17 00:00:00 2001 From: Ben Gardiner Date: Tue, 9 Aug 2011 16:57:28 -0400 Subject: nandtest: print number of bits corrected during test The nandtest program monitors the corrected ecc stat to determine if an ECC correction has taken place during the last write-read. If so, it prints "ECC corrected". The mtd subsytem will store the number of bits corrected in the corrected ecc stat so update the nandtest output to print also the number of bits corrected when performing the test. Signed-off-by: Ben Gardiner Signed-off-by: Artem Bityutskiy --- nandtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nandtest.c b/nandtest.c index d03dc11..dc28d09 100644 --- a/nandtest.c +++ b/nandtest.c @@ -98,7 +98,9 @@ int erase_and_write(loff_t ofs, unsigned char *data, unsigned char *rbuf) } if (newstats.corrected > oldstats.corrected) { - printf("\nECC corrected at %08x\n", (unsigned) ofs); + printf("\n %d bit(s) ECC corrected at %08x\n", + newstats.corrected - oldstats.corrected, + (unsigned) ofs); oldstats.corrected = newstats.corrected; } if (newstats.failed > oldstats.failed) { -- cgit v1.2.3