[PATCH 2/3] nandtest: print number of bits corrected during test

Ben Gardiner bengardiner at nanometrics.ca
Tue Aug 9 16:57:28 EDT 2011


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 at nanometrics.ca>
---
 nandtest.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

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) {
-- 
1.7.3.5




More information about the linux-mtd mailing list