public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/4] cmd: mem: Correctly count the errors in mtest
@ 2020-03-05  6:21 Stefan Roese
  2020-03-05  6:21 ` [PATCH 2/4] cmd: mem: Drop eldk-4.2 workaround and use cast in unmap_sysmem() Stefan Roese
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Stefan Roese @ 2020-03-05  6:21 UTC (permalink / raw)
  To: u-boot

This patch changes mtest to correctly count the overall errors and
print them even in the abort (Ctrl-C) case.

Signed-off-by: Stefan Roese <sr@denx.de>
---
 cmd/mem.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/cmd/mem.c b/cmd/mem.c
index 6d54f19527..9367278aa8 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -871,7 +871,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 	ulong start, end;
 	vu_long *buf, *dummy;
 	ulong iteration_limit = 0;
-	int ret;
+	ulong count = 0;
 	ulong errs = 0;	/* number of errors, or -1 if interrupted */
 	ulong pattern = 0;
 	int iteration;
@@ -929,6 +929,7 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 		}
 		if (errs == -1UL)
 			break;
+		count += errs;
 	}
 
 	/*
@@ -947,14 +948,10 @@ static int do_mem_mtest(cmd_tbl_t *cmdtp, int flag, int argc,
 	if (errs == -1UL) {
 		/* Memory test was aborted - write a newline to finish off */
 		putc('\n');
-		ret = 1;
-	} else {
-		printf("Tested %d iteration(s) with %lu errors.\n",
-			iteration, errs);
-		ret = errs != 0;
 	}
+	printf("Tested %d iteration(s) with %lu errors.\n", iteration, count);
 
-	return ret;
+	return errs != 0;
 }
 #endif	/* CONFIG_CMD_MEMTEST */
 
-- 
2.25.1

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

end of thread, other threads:[~2020-09-19 12:34 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-05  6:21 [PATCH 1/4] cmd: mem: Correctly count the errors in mtest Stefan Roese
2020-03-05  6:21 ` [PATCH 2/4] cmd: mem: Drop eldk-4.2 workaround and use cast in unmap_sysmem() Stefan Roese
2020-04-21 12:26   ` Tom Rini
2020-03-05  6:21 ` [PATCH 3/4] cmd: mem: Use IS_ENABLED instead of alt_test variable Stefan Roese
2020-04-21 12:26   ` Tom Rini
2020-03-05  6:21 ` [PATCH 4/4] cmd: mem: Add bitflip memory test to alternate mtest Stefan Roese
2020-04-21 12:26   ` Tom Rini
2020-09-09  1:33   ` [PATCH] cmd: mem: fix range of bitflip test Ralph Siemsen
2020-09-09  8:49     ` Stefan Roese
2020-09-09 13:02       ` [PATCH v2] " Ralph Siemsen
2020-09-09 13:35         ` Stefan Roese
2020-09-09 15:21         ` [PATCH v3] " Ralph Siemsen
2020-09-09 15:30           ` Stefan Roese
2020-09-09 15:42             ` [PATCH v4] " Ralph Siemsen
2020-09-09 16:10             ` [PATCH v5] " Ralph Siemsen
2020-09-10  5:09               ` Stefan Roese
2020-09-19 12:34               ` Tom Rini
2020-09-09 13:06       ` [PATCH] " Ralph Siemsen
2020-09-09 13:34         ` Stefan Roese
2020-09-09 13:49           ` Ralph Siemsen
2020-09-09 13:53             ` Stefan Roese
2020-09-09 15:07               ` Ralph Siemsen
2020-09-09 15:13                 ` Stefan Roese
2020-09-09 15:17                   ` Ralph Siemsen
2020-04-21 12:26 ` [PATCH 1/4] cmd: mem: Correctly count the errors in mtest Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox