]> www.infradead.org Git - mtd-utils.git/commitdiff
nandtest: print number of bits corrected during test
authorBen Gardiner <bengardiner@nanometrics.ca>
Tue, 9 Aug 2011 20:57:28 +0000 (16:57 -0400)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Thu, 25 Aug 2011 11:00:11 +0000 (14:00 +0300)
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 <bengardiner@nanometrics.ca>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
nandtest.c

index d03dc1110fa4766f107706ccc94e31910ac1f358..dc28d0967e9f226331bd32c5e9a5afcfe82f0b8c 100644 (file)
@@ -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) {