From 730fa039f16df58c2dc3ff2894b7d767f100cf6e Mon Sep 17 00:00:00 2001 From: Thomas Langer Date: Wed, 2 May 2012 12:27:39 +0200 Subject: [PATCH] MIPS: lantiq: fix cmdline parsing The code tested if the KSEG1 mapped address of argv was != 0. We need to use CPHYSADDR instead to make the conditional actually work. Signed-off-by: Thomas Langer Signed-off-by: John Crispin Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/3722/ Signed-off-by: Ralf Baechle --- arch/mips/lantiq/prom.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c index 664b7b722248..cd568921f191 100644 --- a/arch/mips/lantiq/prom.c +++ b/arch/mips/lantiq/prom.c @@ -45,10 +45,12 @@ static void __init prom_init_cmdline(void) char **argv = (char **) KSEG1ADDR(fw_arg1); int i; - for (i = 0; i < argc; i++) { - char *p = (char *) KSEG1ADDR(argv[i]); + arcs_cmdline[0] = '\0'; - if (p && *p) { + for (i = 0; i < argc; i++) { + char *p = (char *) KSEG1ADDR(argv[i]); + + if (CPHYSADDR(p) && *p) { strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); }