Skip to content

Commit

Permalink
sh: Add a printk() to warn legacy mem= growers.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stuart Menefy authored and Paul Mundt committed Jan 28, 2008
1 parent 74d99a5 commit 80a68a4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 80a68a4

Please sign in to comment.