680a8dcd3840c76d29601067dd1cdee0eddbfb69
[15.05/openwrt.git] / target / linux / lantiq / patches-3.0 / 0002-MIPS-lantiq-fix-cmdline-parsing.patch
1 From b85d5204f2fe8c3b5e6172f7cc1741ad6e849334 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Fri, 12 Aug 2011 16:27:38 +0200
4 Subject: [PATCH 02/24] MIPS: lantiq: fix cmdline parsing
5
6 The code tested if the KSEG1 mapped address of argv was != 0. We need to use
7 CPHYSADDR instead to make the conditional actually work.
8
9 Signed-off-by: Thomas Langer <thomas.langer@lantiq.com>
10 Signed-off-by: John Crispin <blogic@openwrt.org>
11 Cc: linux-mips@linux-mips.org
12 ---
13  arch/mips/lantiq/prom.c |    6 ++++--
14  1 files changed, 4 insertions(+), 2 deletions(-)
15
16 diff --git a/arch/mips/lantiq/prom.c b/arch/mips/lantiq/prom.c
17 index 56ba007..5035c10 100644
18 --- a/arch/mips/lantiq/prom.c
19 +++ b/arch/mips/lantiq/prom.c
20 @@ -45,10 +45,12 @@ static void __init prom_init_cmdline(void)
21         char **argv = (char **) KSEG1ADDR(fw_arg1);
22         int i;
23  
24 +       arcs_cmdline[0] = '\0';
25 +
26         for (i = 0; i < argc; i++) {
27 -               char *p = (char *)  KSEG1ADDR(argv[i]);
28 +               char *p = (char *) KSEG1ADDR(argv[i]);
29  
30 -               if (p && *p) {
31 +               if (CPHYSADDR(p) && *p) {
32                         strlcat(arcs_cmdline, p, sizeof(arcs_cmdline));
33                         strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline));
34                 }
35 -- 
36 1.7.5.4
37