Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: ingenic: Use common cmdline handling code

jz4740_init_cmdline appends all arguments from argv (in fw_arg1) to
arcs_cmdline, up to argc (in fw_arg0). The common code in
fw_init_cmdline will do the exact same thing when run on a system where
fw_arg0 isn't a pointer to kseg0 (it'll also set _fw_envp but we don't
use it). Remove the custom implementation & use the generic code.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Reviewed-by: James Hogan <jhogan@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Maarten ter Huurne <maarten@treewalker.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18484/
Signed-off-by: James Hogan <jhogan@kernel.org>

authored by

Paul Burton and committed by
James Hogan
e08a48d9 8ce355cf

+2 -22
+2 -22
arch/mips/jz4740/prom.c
··· 20 20 #include <linux/serial_reg.h> 21 21 22 22 #include <asm/bootinfo.h> 23 + #include <asm/fw/fw.h> 23 24 #include <asm/mach-jz4740/base.h> 24 - 25 - static __init void jz4740_init_cmdline(int argc, char *argv[]) 26 - { 27 - unsigned int count = COMMAND_LINE_SIZE - 1; 28 - int i; 29 - char *dst = &(arcs_cmdline[0]); 30 - char *src; 31 - 32 - for (i = 1; i < argc && count; ++i) { 33 - src = argv[i]; 34 - while (*src && count) { 35 - *dst++ = *src++; 36 - --count; 37 - } 38 - *dst++ = ' '; 39 - } 40 - if (i > 1) 41 - --dst; 42 - 43 - *dst = 0; 44 - } 45 25 46 26 void __init prom_init(void) 47 27 { 48 - jz4740_init_cmdline((int)fw_arg0, (char **)fw_arg1); 49 28 mips_machtype = MACH_INGENIC_JZ4740; 29 + fw_init_cmdline(); 50 30 } 51 31 52 32 void __init prom_free_prom_memory(void)