From: Stuart Menefy Date: Mon, 26 Nov 2007 12:16:09 +0000 (+0900) Subject: sh: Add a printk() to warn legacy mem= growers. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=80a68a43d90e2221599b507b6b26c3cba1957687;p=linux-beck.git sh: Add a printk() to warn legacy mem= growers. mem= can't be used to grow the size of kernel memory, so provide a warning to that effect. Signed-off-by: Stuart Menefy Signed-off-by: Paul Mundt --- diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c index 6891cc93548e..7eb7fdcce0f8 100644 --- a/arch/sh/kernel/setup.c +++ b/arch/sh/kernel/setup.c @@ -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;