summaryrefslogtreecommitdiffstats
path: root/commands/memtest.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-10-23 11:29:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-03 07:27:47 +0100
commite96b1713eaef979a9e6fa41b2f63b05fadbabb3c (patch)
treee96a492a97c8070496d9c8fea5865fd6c247cd07 /commands/memtest.c
parentb792124a7dd30f03b9ad0e06589b5b58ed930d3b (diff)
downloadbarebox-e96b1713eaef979a9e6fa41b2f63b05fadbabb3c.tar.gz
memtest: split tests in separate functions
The memtest does a bus integrity check and a moving inversions test. Split the tests into two separate functions so that the can be called separately. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/memtest.c')
-rw-r--r--commands/memtest.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/commands/memtest.c b/commands/memtest.c
index db9e3db..ccccc9c 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -41,7 +41,14 @@ static int __do_memtest(struct list_head *memtest_regions,
remap_range((void *)r->r->start, r->r->end -
r->r->start + 1, cache_flag);
- ret = mem_test(r->r->start, r->r->end, bus_only);
+ ret = mem_test_bus_integrity(r->r->start, r->r->end);
+ if (ret < 0)
+ return ret;
+
+ if (bus_only)
+ continue;
+
+ ret = mem_test_moving_inversions(r->r->start, r->r->end);
if (ret < 0)
return ret;
printf("done.\n\n");