From e96b1713eaef979a9e6fa41b2f63b05fadbabb3c Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 23 Oct 2015 11:29:59 +0200 Subject: 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 --- common/memtest.c | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) (limited to 'common') diff --git a/common/memtest.c b/common/memtest.c index 467eea546d..4a84dc3b54 100644 --- a/common/memtest.c +++ b/common/memtest.c @@ -331,8 +331,7 @@ int mem_test_bus_integrity(resource_size_t _start, return 0; } -int mem_test_dram(resource_size_t _start, - resource_size_t _end) +int mem_test_moving_inversions(resource_size_t _start, resource_size_t _end) { volatile resource_size_t *start, num_words, offset, temp, anti_pattern; @@ -438,36 +437,3 @@ int mem_test_dram(resource_size_t _start, return 0; } - -/* - * Perform a memory test. The complete test - * loops until interrupted by ctrl-c. - * - * Prameters: - * start: start address for memory test. - * end: end address of memory test. - * bus_only: skip integrity check and do only a address/data bus - * testing. - * - * Return value can be -EINVAL for invalid parameter or -EINTR - * if memory test was interrupted. - */ -int mem_test(resource_size_t _start, - resource_size_t _end, int bus_only) -{ - int ret; - - ret = mem_test_bus_integrity(_start, _end); - - if (ret < 0) - return ret; - - /* - * We tested only the bus if != 0 - * leaving here - */ - if (!bus_only) - ret = mem_test_dram(_start, _end); - - return ret; -} -- cgit v1.2.3