MIPS: Replace all usages of CL_SIZE by COMMAND_LINE_SIZE

The MIPS-specific macro CL_SIZE is merely aliasing the macro
COMMAND_LINE_SIZE. Other architectures use the latter; also,
COMMAND_LINE_SIZE is documented in kernel-parameters.txt, so
let's use it, and remove the alias.

Signed-off-by: Dmitri Vorobiev <dmitri.vorobiev@movial.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Dmitri Vorobiev 2009-10-13 23:43:24 +03:00 committed by Ralf Baechle
parent cb6edd45f0
commit 7580c9c393
8 changed files with 17 additions and 19 deletions

View file

@ -100,11 +100,11 @@ static __init void prom_init_console(void)
static __init void prom_init_cmdline(void) static __init void prom_init_cmdline(void)
{ {
static char buf[CL_SIZE] __initdata; static char buf[COMMAND_LINE_SIZE] __initdata;
/* Get the kernel command line from CFE */ /* Get the kernel command line from CFE */
if (cfe_getenv("LINUX_CMDLINE", buf, CL_SIZE) >= 0) { if (cfe_getenv("LINUX_CMDLINE", buf, COMMAND_LINE_SIZE) >= 0) {
buf[CL_SIZE-1] = 0; buf[COMMAND_LINE_SIZE - 1] = 0;
strcpy(arcs_cmdline, buf); strcpy(arcs_cmdline, buf);
} }
@ -112,13 +112,13 @@ static __init void prom_init_cmdline(void)
* as CFE is not available anymore later in the boot process. */ * as CFE is not available anymore later in the boot process. */
if ((strstr(arcs_cmdline, "console=")) == NULL) { if ((strstr(arcs_cmdline, "console=")) == NULL) {
/* Try to read the default serial port used by CFE */ /* Try to read the default serial port used by CFE */
if ((cfe_getenv("BOOT_CONSOLE", buf, CL_SIZE) < 0) if ((cfe_getenv("BOOT_CONSOLE", buf, COMMAND_LINE_SIZE) < 0)
|| (strncmp("uart", buf, 4))) || (strncmp("uart", buf, 4)))
/* Default to uart0 */ /* Default to uart0 */
strcpy(buf, "uart0"); strcpy(buf, "uart0");
/* Compute the new command line */ /* Compute the new command line */
snprintf(arcs_cmdline, CL_SIZE, "%s console=ttyS%c,115200", snprintf(arcs_cmdline, COMMAND_LINE_SIZE, "%s console=ttyS%c,115200",
arcs_cmdline, buf[4]); arcs_cmdline, buf[4]);
} }
} }

View file

@ -69,8 +69,6 @@
#define MACH_DEXXON_GDIUM2F10 5 #define MACH_DEXXON_GDIUM2F10 5
#define MACH_LOONGSON_END 6 #define MACH_LOONGSON_END 6
#define CL_SIZE COMMAND_LINE_SIZE
extern char *system_type; extern char *system_type;
const char *get_system_type(void); const char *get_system_type(void);
@ -107,7 +105,7 @@ extern void free_init_pages(const char *what,
/* /*
* Initial kernel command line, usually setup by prom_init() * Initial kernel command line, usually setup by prom_init()
*/ */
extern char arcs_cmdline[CL_SIZE]; extern char arcs_cmdline[COMMAND_LINE_SIZE];
/* /*
* Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware * Registers a0, a1, a3 and a4 as passed to the kernel entry by firmware

View file

@ -58,8 +58,8 @@ EXPORT_SYMBOL(mips_machtype);
struct boot_mem_map boot_mem_map; struct boot_mem_map boot_mem_map;
static char command_line[CL_SIZE]; static char command_line[COMMAND_LINE_SIZE];
char arcs_cmdline[CL_SIZE]=CONFIG_CMDLINE; char arcs_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
/* /*
* mips_io_port_base is the begin of the address space to which x86 style * mips_io_port_base is the begin of the address space to which x86 style

View file

@ -100,8 +100,8 @@ void __init prom_init(void)
/* Get the command line */ /* Get the command line */
if (argc > 0) { if (argc > 0) {
strncpy(arcs_cmdline, argv[0], CL_SIZE-1); strncpy(arcs_cmdline, argv[0], COMMAND_LINE_SIZE-1);
arcs_cmdline[CL_SIZE-1] = '\0'; arcs_cmdline[COMMAND_LINE_SIZE-1] = '\0';
} }
/* Set the I/O base address */ /* Set the I/O base address */

View file

@ -55,7 +55,7 @@ static struct prom_pmemblock * __init prom_getmdesc(void)
char *memsize_str; char *memsize_str;
unsigned int memsize; unsigned int memsize;
char *ptr; char *ptr;
static char cmdline[CL_SIZE] __initdata; static char cmdline[COMMAND_LINE_SIZE] __initdata;
/* otherwise look in the environment */ /* otherwise look in the environment */
memsize_str = prom_getenv("memsize"); memsize_str = prom_getenv("memsize");

View file

@ -69,7 +69,7 @@ static inline unsigned long tag2ul(char *arg, const char *tag)
void __init prom_setup_cmdline(void) void __init prom_setup_cmdline(void)
{ {
static char cmd_line[CL_SIZE] __initdata; static char cmd_line[COMMAND_LINE_SIZE] __initdata;
char *cp, *board; char *cp, *board;
int prom_argc; int prom_argc;
char **prom_argv, **prom_envp; char **prom_argv, **prom_envp;
@ -115,7 +115,7 @@ void __init prom_setup_cmdline(void)
strcpy(cp, arcs_cmdline); strcpy(cp, arcs_cmdline);
cp += strlen(arcs_cmdline); cp += strlen(arcs_cmdline);
} }
cmd_line[CL_SIZE-1] = '\0'; cmd_line[COMMAND_LINE_SIZE - 1] = '\0';
strcpy(arcs_cmdline, cmd_line); strcpy(arcs_cmdline, cmd_line);
} }

View file

@ -287,7 +287,7 @@ void __init prom_init(void)
* boot console * boot console
*/ */
cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE); cfe_cons_handle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
if (cfe_getenv("LINUX_CMDLINE", arcs_cmdline, CL_SIZE) < 0) { if (cfe_getenv("LINUX_CMDLINE", arcs_cmdline, COMMAND_LINE_SIZE) < 0) {
if (argc >= 0) { if (argc >= 0) {
/* The loader should have set the command line */ /* The loader should have set the command line */
/* too early for panic to do any good */ /* too early for panic to do any good */
@ -318,7 +318,7 @@ void __init prom_init(void)
#endif /* CONFIG_BLK_DEV_INITRD */ #endif /* CONFIG_BLK_DEV_INITRD */
/* Not sure this is needed, but it's the safe way. */ /* Not sure this is needed, but it's the safe way. */
arcs_cmdline[CL_SIZE-1] = 0; arcs_cmdline[COMMAND_LINE_SIZE-1] = 0;
prom_meminit(); prom_meminit();

View file

@ -160,7 +160,7 @@ static void __init prom_init_cmdline(void)
int argc; int argc;
int *argv32; int *argv32;
int i; /* Always ignore the "-c" at argv[0] */ int i; /* Always ignore the "-c" at argv[0] */
static char builtin[CL_SIZE] __initdata; static char builtin[COMMAND_LINE_SIZE] __initdata;
if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) { if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) {
/* /*
@ -315,7 +315,7 @@ static inline void txx9_cache_fixup(void)
static void __init preprocess_cmdline(void) static void __init preprocess_cmdline(void)
{ {
static char cmdline[CL_SIZE] __initdata; static char cmdline[COMMAND_LINE_SIZE] __initdata;
char *s; char *s;
strcpy(cmdline, arcs_cmdline); strcpy(cmdline, arcs_cmdline);