MIPS: ingenic: Use common cmdline handling code

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/e08a48d9250184d8ce6dc6c728b2ca68d7f40f35
Commit:     e08a48d9250184d8ce6dc6c728b2ca68d7f40f35
Parent:     8ce355cf2e38afdb364d03d12b23d9cf44c3b7f1
Refname:    refs/heads/master
Author:     Paul Burton <[email protected]>
AuthorDate: Tue Jan 16 16:47:58 2018 +0100
Committer:  James Hogan <[email protected]>
CommitDate: Thu Jan 18 22:07:09 2018 +0000

    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 <[email protected]>
    Reviewed-by: PrasannaKumar Muralidharan <[email protected]>
    Reviewed-by: James Hogan <[email protected]>
    Cc: Ralf Baechle <[email protected]>
    Cc: Maarten ter Huurne <[email protected]>
    Cc: [email protected]
    Patchwork: https://patchwork.linux-mips.org/patch/18484/
    Signed-off-by: James Hogan <[email protected]>
---
 arch/mips/jz4740/prom.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/arch/mips/jz4740/prom.c b/arch/mips/jz4740/prom.c
index 47e857194ce6..a62dd8e6ecf9 100644
--- a/arch/mips/jz4740/prom.c
+++ b/arch/mips/jz4740/prom.c
@@ -20,33 +20,13 @@
 #include <linux/serial_reg.h>
 
 #include <asm/bootinfo.h>
+#include <asm/fw/fw.h>
 #include <asm/mach-jz4740/base.h>
 
-static __init void jz4740_init_cmdline(int argc, char *argv[])
-{
-	unsigned int count = COMMAND_LINE_SIZE - 1;
-	int i;
-	char *dst = &(arcs_cmdline[0]);
-	char *src;
-
-	for (i = 1; i < argc && count; ++i) {
-		src = argv[i];
-		while (*src && count) {
-			*dst++ = *src++;
-			--count;
-		}
-		*dst++ = ' ';
-	}
-	if (i > 1)
-		--dst;
-
-	*dst = 0;
-}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.