MIPS: lantiq: fix cmdline parsing
authorThomas Langer <thomas.langer@lantiq.com>
Wed, 2 May 2012 10:27:39 +0000 (12:27 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 15 May 2012 15:49:22 +0000 (17:49 +0200)
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 <thomas.langer@lantiq.com>
Signed-off-by: John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3722/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/lantiq/prom.c

index 664b7b7222487b03d345b0316f9d240d1ef8b605..cd568921f19117c8ae35912ca2d519782be10b3e 100644 (file)
@@ -45,10 +45,12 @@ static void __init prom_init_cmdline(void)
        char **argv = (char **) KSEG1ADDR(fw_arg1);
        int i;
 
+       arcs_cmdline[0] = '\0';
+
        for (i = 0; i < argc; i++) {
-               char *p = (char *)  KSEG1ADDR(argv[i]);
+               char *p = (char *) KSEG1ADDR(argv[i]);
 
-               if (p && *p) {
+               if (CPHYSADDR(p) && *p) {
                        strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
                        strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
                }
This page took 0.026364 seconds and 5 git commands to generate.