public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [PATCH 1/4] cmd: mem: Correctly count the errors in mtest
Date: Thu,  5 Mar 2020 07:21:29 +0100	[thread overview]
Message-ID: <20200305062132.22932-1-sr@denx.de> (raw)

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

             reply	other threads:[~2020-03-05  6:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-05  6:21 Stefan Roese [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305062132.22932-1-sr@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox