* [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments
@ 2010-01-26 9:07 Yoichi Yuasa
2010-01-26 9:08 ` [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[] Yoichi Yuasa
2010-01-26 10:36 ` [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Ralf Baechle
0 siblings, 2 replies; 4+ messages in thread
From: Yoichi Yuasa @ 2010-01-26 9:07 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yuasa, linux-mips
Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
arch/mips/ar7/prom.c | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index c1fdd36..43b21c0 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -56,22 +56,12 @@ char * __init prom_getcmdline(void)
static void __init ar7_init_cmdline(int argc, char *argv[])
{
- char *cp;
- int actr;
-
- actr = 1; /* Always ignore argv[0] */
+ int i;
- cp = &(arcs_cmdline[0]);
- while (actr < argc) {
- strcpy(cp, argv[actr]);
- cp += strlen(argv[actr]);
- *cp++ = ' ';
- actr++;
- }
- if (cp != &(arcs_cmdline[0])) {
- /* get rid of trailing space */
- --cp;
- *cp = '\0';
+ for (i = 1; i < argc; i++) {
+ strlcat(arcs_cmdline, argv[i], COMMAND_LINE_SIZE);
+ if (i < (argc - 1))
+ strlcat(arcs_cmdline, " ", COMMAND_LINE_SIZE);
}
}
@@ -250,7 +240,7 @@ static void __init console_config(void)
else
sprintf(console_string, " console=ttyS0,%d%c%c", baud, parity,
bits);
- strcat(prom_getcmdline(), console_string);
+ strlcat(arcs_cmdline, console_string, COMMAND_LINE_SIZE);
#endif
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[]
2010-01-26 9:07 [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Yoichi Yuasa
@ 2010-01-26 9:08 ` Yoichi Yuasa
2010-01-26 10:37 ` Ralf Baechle
2010-01-26 10:36 ` [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Ralf Baechle
1 sibling, 1 reply; 4+ messages in thread
From: Yoichi Yuasa @ 2010-01-26 9:08 UTC (permalink / raw)
To: Ralf Baechle; +Cc: yuasa, linux-mips
Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
---
arch/mips/ar7/prom.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c
index 43b21c0..4d75ff1 100644
--- a/arch/mips/ar7/prom.c
+++ b/arch/mips/ar7/prom.c
@@ -49,11 +49,6 @@ char *prom_getenv(const char *name)
}
EXPORT_SYMBOL(prom_getenv);
-char * __init prom_getcmdline(void)
-{
- return &(arcs_cmdline[0]);
-}
-
static void __init ar7_init_cmdline(int argc, char *argv[])
{
int i;
@@ -206,7 +201,7 @@ static void __init console_config(void)
char parity = '\0', bits = '\0', flow = '\0';
char *s, *p;
- if (strstr(prom_getcmdline(), "console="))
+ if (strstr(arcs_cmdline, "console="))
return;
s = prom_getenv("modetty0");
--
1.6.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments
2010-01-26 9:07 [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Yoichi Yuasa
2010-01-26 9:08 ` [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[] Yoichi Yuasa
@ 2010-01-26 10:36 ` Ralf Baechle
1 sibling, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2010-01-26 10:36 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips
On Tue, Jan 26, 2010 at 06:07:02PM +0900, Yoichi Yuasa wrote:
Queued for 2.6.34. Thanks!
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[]
2010-01-26 9:08 ` [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[] Yoichi Yuasa
@ 2010-01-26 10:37 ` Ralf Baechle
0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2010-01-26 10:37 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips
On Tue, Jan 26, 2010 at 06:08:34PM +0900, Yoichi Yuasa wrote:
Thanks, also queued for 2.6.34.
Ralf
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-01-26 10:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26 9:07 [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Yoichi Yuasa
2010-01-26 9:08 ` [PATCH 2/2] MIPS: AR7: replace prom_getcmdline() to arcs_cmdline[] Yoichi Yuasa
2010-01-26 10:37 ` Ralf Baechle
2010-01-26 10:36 ` [PATCH 1/2] MIPS: AR7: use strlcat() for the command line arguments Ralf Baechle
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.