Commit f257b063 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

[S390] xpram module parameter parsing - take 2.

Don't use memparse since the default size modifier is 'k'.
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 5a651c93
...@@ -304,6 +304,7 @@ static int __init xpram_setup_sizes(unsigned long pages) ...@@ -304,6 +304,7 @@ static int __init xpram_setup_sizes(unsigned long pages)
{ {
unsigned long mem_needed; unsigned long mem_needed;
unsigned long mem_auto; unsigned long mem_auto;
unsigned long long size;
int mem_auto_no; int mem_auto_no;
int i; int i;
...@@ -321,9 +322,19 @@ static int __init xpram_setup_sizes(unsigned long pages) ...@@ -321,9 +322,19 @@ static int __init xpram_setup_sizes(unsigned long pages)
mem_needed = 0; mem_needed = 0;
mem_auto_no = 0; mem_auto_no = 0;
for (i = 0; i < xpram_devs; i++) { for (i = 0; i < xpram_devs; i++) {
if (sizes[i]) if (sizes[i]) {
xpram_sizes[i] = size = simple_strtoull(sizes[i], &sizes[i], 0);
(memparse(sizes[i], &sizes[i]) + 3) & -4UL; switch (sizes[i][0]) {
case 'g':
case 'G':
size <<= 20;
break;
case 'm':
case 'M':
size <<= 10;
}
xpram_sizes[i] = (size + 3) & -4UL;
}
if (xpram_sizes[i]) if (xpram_sizes[i])
mem_needed += xpram_sizes[i]; mem_needed += xpram_sizes[i];
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment