Patchwork nandtest: set oldstats.failed

login
register
mail settings
Submitter Jan Weitzel
Date Nov. 24, 2011, 10:57 a.m.
Message ID <1322132241-5778-1-git-send-email-j.weitzel@phytec.de>
Download mbox | patch
Permalink /patch/127474/
State New
Headers show

Comments

Jan Weitzel - Nov. 24, 2011, 10:57 a.m.
if new ecc failed occures oldstats.corrected is updated not oldstats.failed

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 nandtest.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Artem Bityutskiy - Dec. 1, 2011, 7:56 a.m.
On Thu, 2011-11-24 at 11:57 +0100, Jan Weitzel wrote:
> if new ecc failed occures oldstats.corrected is updated not oldstats.failed
> 
> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>

Pushed to mtd-utils.git, thanks!

Artem.

Patch

diff --git a/nandtest.c b/nandtest.c
index dc28d09..db7f427 100644
--- a/nandtest.c
+++ b/nandtest.c
@@ -105,7 +105,7 @@  int erase_and_write(loff_t ofs, unsigned char *data, unsigned char *rbuf)
 	}
 	if (newstats.failed > oldstats.failed) {
 		printf("\nECC failed at %08x\n", (unsigned) ofs);
-		oldstats.corrected = newstats.corrected;
+		oldstats.failed = newstats.failed;
 	}
 	if (len < meminfo.erasesize)
 		exit(1);