[PATCH] Philips PNX8550 command line patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Ralf,

This patch makes passing command line from bootloader for Philips PNX8550 platform.
Does it makes sense to commit this patch?

Vladimir
--- linux-2.6.15/arch/mips/philips/pnx8550/jbs/init.c	2005-12-02 16:37:59.000000000 +0300
+++ linux-2.6.15/arch/mips/philips/pnx8550/jbs/init.c	2005-12-06 13:12:22.000000000 +0300
@@ -47,6 +47,11 @@ void __init prom_init(void)
 {
 
 	unsigned long memsize;
+	prom_argc = (int) fw_arg0;
+	prom_argv = (char **) fw_arg1;
+	prom_envp = (char **) fw_arg2;
+
+	prom_init_cmdline();
 
 	mips_machgroup = MACH_GROUP_PHILIPS;
 	mips_machtype = MACH_PHILIPS_JBS;
--- linux-2.6.15/arch/mips/philips/pnx8550/common/prom.c	2005-12-02 16:37:59.000000000 +0300
+++ linux-2.6.15/arch/mips/philips/pnx8550/common/prom.c	2005-12-06 13:48:10.000000000 +0300
@@ -35,23 +35,15 @@ char * prom_getcmdline(void)
 	return &(arcs_cmdline[0]);
 }
 
-void  prom_init_cmdline(void)
+void __init prom_init_cmdline(void)
 {
-	char *cp;
-	int actr;
-
-	actr = 1; /* Always ignore argv[0] */
+	int i;
 
-	cp = &(arcs_cmdline[0]);
-	while(actr < prom_argc) {
-	        strcpy(cp, prom_argv[actr]);
-		cp += strlen(prom_argv[actr]);
-		*cp++ = ' ';
-		actr++;
+	arcs_cmdline[0] = '\0';
+	for (i = 0; i < prom_argc; i++) {
+		strcat(arcs_cmdline, prom_argv[i]);
+		strcat(arcs_cmdline, " ");
 	}
-	if (cp != &(arcs_cmdline[0])) /* get rid of trailing space */
-		--cp;
-	*cp = '\0';
 }
 
 char *prom_getenv(char *envname)

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux