sh: Add a printk() to warn legacy mem= growers.
authorStuart Menefy <stuart.menefy@st.com>
Mon, 26 Nov 2007 12:16:09 +0000 (21:16 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 28 Jan 2008 04:18:57 +0000 (13:18 +0900)
mem= can't be used to grow the size of kernel memory, so provide a
warning to that effect.

Signed-off-by: Stuart Menefy <stuart.menefy@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/setup.c

index 6891cc93548eed7657856b4068f6a6daf30d5efe..7eb7fdcce0f83bb7435276d098c8129341948290 100644 (file)
@@ -84,6 +84,17 @@ static int __init early_parse_mem(char *p)
 
        memory_start = (unsigned long)PAGE_OFFSET+__MEMORY_START;
        size = memparse(p, &p);
+
+       if (size > __MEMORY_SIZE) {
+               static char msg[] __initdata = KERN_ERR
+                       "Using mem= to increase the size of kernel memory "
+                       "is not allowed.\n"
+                       "  Recompile the kernel with the correct value for "
+                       "CONFIG_MEMORY_SIZE.\n";
+               printk(msg);
+               return 0;
+       }
+
        memory_end = memory_start + size;
 
        return 0;