summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2006-03-27 18:26:42 -0600
committerKumar Gala <galak@kernel.crashing.org>2006-03-27 18:26:42 -0600
commit10d713aef238b02a774766b2622027361630e28d (patch)
treecbade374a5542732d81c70eac5cd241a311eb4b0 /arch/powerpc/kernel/prom.c
parentcbd312b94ed123dc7080c9591cb715cd2a7327c0 (diff)
downloadop-kernel-dev-10d713aef238b02a774766b2622027361630e28d.zip
op-kernel-dev-10d713aef238b02a774766b2622027361630e28d.tar.gz
powerpc: use memparse() for mem= command line parsing
Use memparse() instead of our own code for handling the parsing of mem= Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r--arch/powerpc/kernel/prom.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 5a24415..95d15eb 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1030,25 +1030,13 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
if (strstr(cmd_line, "mem=")) {
char *p, *q;
- unsigned long maxmem = 0;
for (q = cmd_line; (p = strstr(q, "mem=")) != 0; ) {
q = p + 4;
if (p > cmd_line && p[-1] != ' ')
continue;
- maxmem = simple_strtoul(q, &q, 0);
- if (*q == 'k' || *q == 'K') {
- maxmem <<= 10;
- ++q;
- } else if (*q == 'm' || *q == 'M') {
- maxmem <<= 20;
- ++q;
- } else if (*q == 'g' || *q == 'G') {
- maxmem <<= 30;
- ++q;
- }
+ memory_limit = memparse(q, &q);
}
- memory_limit = maxmem;
}
/* break now */
OpenPOWER on IntegriCloud