By just reversing the order memtest is using the test patterns, an
additional round to zero the memory is not necessary.

This makes it a bit faster.

Signed-off-by: Alexander Holler <[email protected]>
---
 arch/x86/mm/memtest.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c
index 855a6d5..da80083 100644
--- a/arch/x86/mm/memtest.c
+++ b/arch/x86/mm/memtest.c
@@ -9,7 +9,7 @@
 #include <linux/memblock.h>
 
 static u64 patterns[] __initdata = {
-       0,
+       0, /* Has has to be 0 to leave memtest with zeroed memory */
        0xffffffffffffffffULL,
        0x5555555555555555ULL,
        0xaaaaaaaaaaaaaaaaULL,
@@ -112,15 +112,8 @@ void __init early_memtest(unsigned long start, unsigned 
long end)
                return;
 
        pr_info("early_memtest: # of tests: %d\n", memtest_pattern);
-       for (i = 0; i < memtest_pattern; i++) {
+       for (i = memtest_pattern-1; i < UINT_MAX; --i) {
                idx = i % ARRAY_SIZE(patterns);
                do_one_pass(patterns[idx], start, end);
        }
-
-       if (idx > 0) {
-               printk(KERN_INFO "early_memtest: wipe out "
-                      "test pattern from memory\n");
-               /* additional test with pattern 0 will do this */
-               do_one_pass(0, start, end);
-       }
 }
-- 
1.7.8.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to