All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd-utils: tests: Fix nandbiterrs Failure Check
@ 2017-06-23 23:06 harpreet
  2017-06-27 20:11 ` Fabio Estevam
  0 siblings, 1 reply; 4+ messages in thread
From: harpreet @ 2017-06-23 23:06 UTC (permalink / raw)
  To: linux-mtd

From: "Harpreet \"Eli\" Sangha" <harpreet@nestlabs.com>

After a page read, the old failure statistics are compared against the
new failure statistics before the new values are actually read.

Signed-off-by: Harpreet "Eli" Sangha
---
 tests/mtd-tests/nandbiterrs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/mtd-tests/nandbiterrs.c b/tests/mtd-tests/nandbiterrs.c
index 6acbfee..de9d0dd 100644
--- a/tests/mtd-tests/nandbiterrs.c
+++ b/tests/mtd-tests/nandbiterrs.c
@@ -268,15 +268,15 @@ static int read_page(void)
 		return -1;
 	}
 
+	if (ioctl(fd, ECCGETSTATS, &new) != 0)
+		goto failstats;
+
 	if (new.failed > old.failed) {
 		fprintf(stderr, "Failed to recover %d bitflips\n",
 				new.failed - old.failed);
 		return -1;
 	}
 
-	if (ioctl(fd, ECCGETSTATS, &new) != 0)
-		goto failstats;
-
 	return new.corrected - old.corrected;
 failstats:
 	perror("ECCGETSTATS");
-- 
2.13.1.611.g7e3b11ae1-goog

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-28  8:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 23:06 [PATCH] mtd-utils: tests: Fix nandbiterrs Failure Check harpreet
2017-06-27 20:11 ` Fabio Estevam
2017-06-27 20:52   ` Harpreet Eli Sangha
2017-06-28  8:38     ` David Oberhollenzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.