All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir A. Barinov" <vbarinov@ru.mvista.com>
To: ralf@linux-mips.org
Cc: linux-mips@linux-mips.org, ppopov@embeddedalley.com
Subject: [PATCH] Philips PNX8550 command line patch
Date: Tue, 06 Dec 2005 21:02:14 +0300	[thread overview]
Message-ID: <4395D226.9070807@ru.mvista.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

Hello Ralf,

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

Vladimir

[-- Attachment #2: cmdline.patch --]
[-- Type: text/plain, Size: 1287 bytes --]

--- 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)

             reply	other threads:[~2005-12-06 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-06 18:02 Vladimir A. Barinov [this message]
2005-12-06 18:04 ` [PATCH] Philips PNX8550 command line patch Ralf Baechle
2005-12-06 19:21   ` Peter Popov
2005-12-08 17:02     ` Vladimir A. Barinov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4395D226.9070807@ru.mvista.com \
    --to=vbarinov@ru.mvista.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ppopov@embeddedalley.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.