diff mbox

[U-Boot] fix always succesful memory test

Message ID 1452162964-8706-1-git-send-email-rasmus.villemoes@prevas.dk
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Rasmus Villemoes Jan. 7, 2016, 10:36 a.m. UTC
Since 51209b1f42cb ("Use common mtest iteration counting"),
do_mem_mtest has always reported 0 errors and hence returned 0, even
if errors were detected. Fix the helpers mem_test_alt() and
mem_test_quick() to return the number of errors found.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 common/cmd_mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tom Rini Jan. 9, 2016, 3:35 a.m. UTC | #1
On Thu, Jan 07, 2016 at 11:36:04AM +0100, Rasmus Villemoes wrote:

> Since 51209b1f42cb ("Use common mtest iteration counting"),
> do_mem_mtest has always reported 0 errors and hence returned 0, even
> if errors were detected. Fix the helpers mem_test_alt() and
> mem_test_quick() to return the number of errors found.
> 
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 9fb2584..efa3929 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -931,7 +931,7 @@  static ulong mem_test_alt(vu_long *buf, ulong start_addr, ulong end_addr,
 		addr[offset] = 0;
 	}
 
-	return 0;
+	return errs;
 }
 
 static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
@@ -990,7 +990,7 @@  static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
 		val += incr;
 	}
 
-	return 0;
+	return errs;
 }
 
 /*