diff options
-rw-r--r-- | arch/x86/mm/memtest.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/mm/memtest.c b/arch/x86/mm/memtest.c index 9cab18b0b857..00b8bdc64c3e 100644 --- a/arch/x86/mm/memtest.c +++ b/arch/x86/mm/memtest.c | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #include <asm/e820.h> | 10 | #include <asm/e820.h> |
11 | 11 | ||
12 | #define _MAX_MEM_PATTERNS 4 | ||
13 | |||
12 | static void __init memtest(unsigned long start_phys, unsigned long size, | 14 | static void __init memtest(unsigned long start_phys, unsigned long size, |
13 | unsigned pattern) | 15 | unsigned pattern) |
14 | { | 16 | { |
@@ -21,6 +23,8 @@ static void __init memtest(unsigned long start_phys, unsigned long size, | |||
21 | unsigned long count; | 23 | unsigned long count; |
22 | unsigned long incr; | 24 | unsigned long incr; |
23 | 25 | ||
26 | pattern = pattern % _MAX_MEM_PATTERNS; | ||
27 | |||
24 | switch (pattern) { | 28 | switch (pattern) { |
25 | case 0: | 29 | case 0: |
26 | val = 0UL; | 30 | val = 0UL; |
@@ -110,8 +114,9 @@ void __init early_memtest(unsigned long start, unsigned long end) | |||
110 | t_size = end - t_start; | 114 | t_size = end - t_start; |
111 | 115 | ||
112 | printk(KERN_CONT "\n %010llx - %010llx pattern %d", | 116 | printk(KERN_CONT "\n %010llx - %010llx pattern %d", |
113 | (unsigned long long)t_start, | 117 | (unsigned long long)t_start, |
114 | (unsigned long long)t_start + t_size, pattern); | 118 | (unsigned long long)t_start + t_size, |
119 | pattern % _MAX_MEM_PATTERNS); | ||
115 | 120 | ||
116 | memtest(t_start, t_size, pattern); | 121 | memtest(t_start, t_size, pattern); |
117 | 122 | ||