]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: Lantiq: Fix cmdline parsing
authorJohn Crispin <blogic@openwrt.org>
Wed, 11 Jan 2012 20:44:25 +0000 (21:44 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Apr 2012 23:22:55 +0000 (00:22 +0100)
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/3258/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/lantiq/prom.c

index 528e205a527229a761304004ff8906e2f9d1c802..ee63a3351a8cdb178ffbaa0daf3e5be8549e4b39 100644 (file)
@@ -49,10 +49,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));
                }