aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cobalt/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-12 20:55:31 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-12 20:55:31 -0800
commitf25bb39f8adfe980df223f415f3b845953ca1147 (patch)
tree720e9a95d36061d133867d07282654dc9825b570 /arch/mips/cobalt/setup.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 (diff)
parentMIPS: Ignore vmlinux.* (diff)
downloadlinux-dev-f25bb39f8adfe980df223f415f3b845953ca1147.tar.xz
linux-dev-f25bb39f8adfe980df223f415f3b845953ca1147.zip
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
* 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus: (22 commits) MIPS: Ignore vmlinux.* MIPS: Move vmlinux.ecoff to arch/mips/boot MIPS: cpumask_of_node() should handle -1 as a node MIPS: Octeon: Use non-overflowing arithmetic in sched_clock MIPS: Malta, PowerTV: Remove unnecessary "Linux started" MIPS: BCM63xx: Remove duplicate CONFIG_CMDLINE. MIPS: AR7: Remove unused prom_getchar() MIPS: PowerTV: Remove extra r4k_clockevent_init() call MIPS: Cobalt use strlcat() for the command line arguments MIPS: Octeon: Add sched_clock() to csrc-octeon.c MIPS: TXx9: Cleanup builtin-cmdline processing MIPS: PowerTV: simplify prom_init_cmdline() and merge into prom_init() MIPS: PowerTV: Remove unused platform_die() MIPS: PowerTV: Remove mips_machine_halt() MIPS: PowerTV: Remove unused ptv_memsize MIPS: PowerTV: Remove unused prom_getcmdline() MIPS: AR7: Remove kgdb_enabled MIPS: Alchemy: Correct code taking the size of a pointer MIPS: BCM63xx: Fix whitespace damaged board_bcm963xx.c MIPS: VR41xx: Use strlcat() for the command line arguments ...
Diffstat (limited to 'arch/mips/cobalt/setup.c')
-rw-r--r--arch/mips/cobalt/setup.c24
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)
void __init prom_init(void)
{
- int narg, indx, posn, nchr;
unsigned long memsz;
+ int argc, i;
char **argv;
memsz = fw_arg0 & 0x7fff0000;
- narg = fw_arg0 & 0x0000ffff;
-
- if (narg) {
- arcs_cmdline[0] = '\0';
- argv = (char **) fw_arg1;
- posn = 0;
- for (indx = 1; indx < narg; ++indx) {
- nchr = strlen(argv[indx]);
- if (posn + 1 + nchr + 1 > sizeof(arcs_cmdline))
- break;
- if (posn)
- arcs_cmdline[posn++] = ' ';
- strcpy(arcs_cmdline + posn, argv[indx]);
- posn += nchr;
- }
+ argc = fw_arg0 & 0x0000ffff;
+ argv = (char **)fw_arg1;
+
+ for (i = 1; i < argc; i++) {
+ strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
+ if (i < (argc - 1))
+ strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
}
add_memory_region(0x0, memsz, BOOT_MEM_RAM);