Skip to content

Commit

Permalink
MIPS: lantiq: fix cmdline parsing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Langer authored and Ralf Baechle committed May 15, 2012
1 parent 7705f68 commit 730fa03
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions arch/mips/lantiq/prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 730fa03

Please sign in to comment.