diff options
-rw-r--r-- | arch/mips/cobalt/setup.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c index b51644227241..ec3b2c417f7c 100644 --- a/arch/mips/cobalt/setup.c +++ b/arch/mips/cobalt/setup.c | |||
@@ -97,26 +97,18 @@ void __init plat_mem_setup(void) | |||
97 | 97 | ||
98 | void __init prom_init(void) | 98 | void __init prom_init(void) |
99 | { | 99 | { |
100 | int narg, indx, posn, nchr; | ||
101 | unsigned long memsz; | 100 | unsigned long memsz; |
101 | int argc, i; | ||
102 | char **argv; | 102 | char **argv; |
103 | 103 | ||
104 | memsz = fw_arg0 & 0x7fff0000; | 104 | memsz = fw_arg0 & 0x7fff0000; |
105 | narg = fw_arg0 & 0x0000ffff; | 105 | argc = fw_arg0 & 0x0000ffff; |
106 | 106 | argv = (char **)fw_arg1; | |
107 | if (narg) { | 107 | |
108 | arcs_cmdline[0] = '\0'; | 108 | for (i = 1; i < argc; i++) { |
109 | argv = (char **) fw_arg1; | 109 | strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE); |
110 | posn = 0; | 110 | if (i < (argc - 1)) |
111 | for (indx = 1; indx < narg; ++indx) { | 111 | strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE); |
112 | nchr = strlen(argv[indx]); | ||
113 | if (posn + 1 + nchr + 1 > sizeof(arcs_cmdline)) | ||
114 | break; | ||
115 | if (posn) | ||
116 | arcs_cmdline[posn++] = ' '; | ||
117 | strcpy(arcs_cmdline + posn, argv[indx]); | ||
118 | posn += nchr; | ||
119 | } | ||
120 | } | 112 | } |
121 | 113 | ||
122 | add_memory_region(0x0, memsz, BOOT_MEM_RAM); | 114 | add_memory_region(0x0, memsz, BOOT_MEM_RAM); |