From: Ben Gardiner Date: Tue, 9 Aug 2011 20:57:28 +0000 (-0400) Subject: nandtest: print number of bits corrected during test X-Git-Tag: v1.4.7~15 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=73c6c15a4f10f9fd437d28a7de9dc90a6ed97826;p=mtd-utils.git 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 --- 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) {