MIPS: Alchemy: remove prom_getcmdline()
PATCH 1/2 MIPS: Alchemy: remove prom_getcmdline()
Signed-off-by Yoichi Yuasa <[email protected]>
--- arch/mips/alchemy/common/prom.c | 9 +-------- arch/mips/include/asm/mach-au1x00/prom.h | 1 - 2 files changed, 1 insertions(+), 9 deletions(-)
arch/mips/alchemy/common/prom.c +1 -8
@@ -43,11 +43,6 @@ int prom_argc;char **prom_argv;char **prom_envp; -char * __init_or_module prom_getcmdline(void) -{ -return &(arcs_cmdline[0 ]); -} -void prom_init_cmdline (void ) {char *cp;
@@ -121,14 +116,12 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str)int prom_get_ethernet_addr (char *ethernet_addr) {char *ethaddr_str; -char *argptr;/* Check the environment variables first */ ethaddr_str =prom_getenv ("ethaddr" );if (!ethaddr_str) {/* Check command line */ - argptr =prom_getcmdline (); - ethaddr_str =strstr (argptr,"ethaddr=" ); + ethaddr_str =strstr (arcs_cmdline,"ethaddr=" );if (!ethaddr_str)return -1 ;
arch/mips/include/asm/mach-au1x00/prom.h +0 -1
@@ -6,7 +6,6 @@ extern char **prom_argv;extern char **prom_envp;extern void prom_init_cmdline (void ); -extern char *prom_getcmdline (void );extern char *prom_getenv (char *envname);extern int prom_get_ethernet_addr (char *ethernet_addr);
Signature · 1 line
1.6.6.1
PATCH 2/2 MIPS: Alchemy: use strlcat() for the command line arguments
Signed-off-by Yoichi Yuasa <[email protected]>
--- arch/mips/alchemy/common/prom.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-)
arch/mips/alchemy/common/prom.c +5 -14
@@ -45,22 +45,13 @@ char **prom_envp;void 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++; +for (i =1 ; i < prom_argc; i++) { +strlcat (arcs_cmdline, prom_argv[i],COMMAND_LINE_SIZE ); +if (i < (prom_argc -1 )) +strlcat (arcs_cmdline," " ,COMMAND_LINE_SIZE ); } -if (cp != &(arcs_cmdline[0 ]))/* get rid of trailing space */ - --cp; -if (prom_argc >1 ) - *cp ='\0' ; }char *prom_getenv (char *envname)
Signature · 1 line
1.6.6.1
Re: [PATCH -queue 2/2] MIPS: Alchemy: use strlcat() for the command line arguments
On Mon, Feb 01, 2010 at 10:06:56PM +0900, Yoichi Yuasa wrote:
Thanks, queued for 2.6.34.
Ralf
On Mon, Feb 01, 2010 at 10:05:57PM +0900, Yoichi Yuasa wrote:
Thanks, queued for 2.6.34.
Ralf