summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/memtest.c9
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 @@
#include <asm/e820.h>
+#define _MAX_MEM_PATTERNS 4
+
static void __init memtest(unsigned long start_phys, unsigned long size,
unsigned pattern)
{
@@ -21,6 +23,8 @@ static void __init memtest(unsigned long start_phys, unsigned long size,
unsigned long count;
unsigned long incr;
+ pattern = pattern % _MAX_MEM_PATTERNS;
+
switch (pattern) {
case 0:
val = 0UL;
@@ -110,8 +114,9 @@ void __init early_memtest(unsigned long start, unsigned long end)
t_size = end - t_start;
printk(KERN_CONT "\n %010llx - %010llx pattern %d",
- (unsigned long long)t_start,
- (unsigned long long)t_start + t_size, pattern);
+ (unsigned long long)t_start,
+ (unsigned long long)t_start + t_size,
+ pattern % _MAX_MEM_PATTERNS);
memtest(t_start, t_size, pattern);
OpenPOWER on IntegriCloud