Commit 53d4b32b authored by Russell King's avatar Russell King Committed by Linus Torvalds

[PATCH] ARM COMMAND_LINE_SIZE build fix

Rework the declaration, sizing and memcpying of saved_command_line[] so
that ARM doesn't need to implement unwelcome header file nestings.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 375f73f9
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <linux/reboot.h> #include <linux/reboot.h>
#endif #endif
#include <linux/notifier.h> #include <linux/notifier.h>
#include <asm/setup.h>
#include <asm/io.h> #include <asm/io.h>
extern struct notifier_block *panic_notifier_list; extern struct notifier_block *panic_notifier_list;
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <asm/setup.h>
/* /*
* Setup options * Setup options
*/ */
......
...@@ -155,8 +155,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -155,8 +155,8 @@ void __init setup_arch(char **cmdline_p)
#endif #endif
/* Keep a copy of command line */ /* Keep a copy of command line */
*cmdline_p = &command_line[0]; *cmdline_p = &command_line[0];
memcpy(saved_command_line, command_line, sizeof(saved_command_line)); memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[sizeof(saved_command_line)-1] = 0; saved_command_line[COMMAND_LINE_SIZE-1] = 0;
#ifdef DEBUG #ifdef DEBUG
if (strlen(*cmdline_p)) if (strlen(*cmdline_p))
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <asm/sal.h> #include <asm/sal.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/serial.h> #include <asm/serial.h>
#include <asm/setup.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/unistd.h> #include <asm/unistd.h>
...@@ -284,7 +285,7 @@ setup_arch (char **cmdline_p) ...@@ -284,7 +285,7 @@ setup_arch (char **cmdline_p)
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist); ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
*cmdline_p = __va(ia64_boot_param->command_line); *cmdline_p = __va(ia64_boot_param->command_line);
strlcpy(saved_command_line, *cmdline_p, sizeof(saved_command_line)); strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
efi_init(); efi_init();
io_port_init(); io_port_init();
......
...@@ -216,8 +216,8 @@ void setup_arch(char **cmdline_p) ...@@ -216,8 +216,8 @@ void setup_arch(char **cmdline_p)
/* Keep a copy of command line */ /* Keep a copy of command line */
*cmdline_p = &command_line[0]; *cmdline_p = &command_line[0];
memcpy(saved_command_line, command_line, sizeof(saved_command_line)); memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[sizeof(saved_command_line)-1] = 0; saved_command_line[COMMAND_LINE_SIZE-1] = 0;
#ifdef DEBUG #ifdef DEBUG
if (strlen(*cmdline_p)) if (strlen(*cmdline_p))
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/setup.h>
#include <asm/system.h> #include <asm/system.h>
struct cpuinfo_mips cpu_data[NR_CPUS]; struct cpuinfo_mips cpu_data[NR_CPUS];
...@@ -489,7 +490,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -489,7 +490,7 @@ void __init setup_arch(char **cmdline_p)
do_earlyinitcalls(); do_earlyinitcalls();
strlcpy(command_line, arcs_cmdline, sizeof(command_line)); strlcpy(command_line, arcs_cmdline, sizeof(command_line));
strlcpy(saved_command_line, command_line, sizeof(saved_command_line)); strlcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
*cmdline_p = command_line; *cmdline_p = command_line;
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <asm/machdep.h> /* for pa7300lc_init() proto */ #include <asm/machdep.h> /* for pa7300lc_init() proto */
#include <asm/pdc_chassis.h> #include <asm/pdc_chassis.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/setup.h>
char command_line[COMMAND_LINE_SIZE]; char command_line[COMMAND_LINE_SIZE];
......
...@@ -676,7 +676,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -676,7 +676,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.brk = (unsigned long) klimit; init_mm.brk = (unsigned long) klimit;
/* Save unparsed command line copy for /proc/cmdline */ /* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, sizeof(saved_command_line)); strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line; *cmdline_p = cmd_line;
/* set up the bootmem stuff with available memory */ /* set up the bootmem stuff with available memory */
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/btext.h> #include <asm/btext.h>
#include <asm/nvram.h> #include <asm/nvram.h>
#include <asm/setup.h>
#include <asm/system.h> #include <asm/system.h>
extern unsigned long klimit; extern unsigned long klimit;
...@@ -629,7 +630,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -629,7 +630,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.brk = klimit; init_mm.brk = klimit;
/* Save unparsed command line copy for /proc/cmdline */ /* Save unparsed command line copy for /proc/cmdline */
strlcpy(saved_command_line, cmd_line, sizeof(saved_command_line)); strlcpy(saved_command_line, cmd_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line; *cmdline_p = cmd_line;
irqstack_early_init(); irqstack_early_init();
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <asm/io_generic.h> #include <asm/io_generic.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/setup.h>
#ifdef CONFIG_SH_KGDB #ifdef CONFIG_SH_KGDB
#include <asm/kgdb.h> #include <asm/kgdb.h>
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <asm/hardirq.h> #include <asm/hardirq.h>
#include <asm/machines.h> #include <asm/machines.h>
#include <asm/cpudata.h> #include <asm/cpudata.h>
#include <asm/setup.h>
struct screen_info screen_info = { struct screen_info screen_info = {
0, 0, /* orig-x, orig-y */ 0, 0, /* orig-x, orig-y */
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/timer.h> #include <asm/timer.h>
#include <asm/sections.h> #include <asm/sections.h>
#include <asm/setup.h>
#ifdef CONFIG_IP_PNP #ifdef CONFIG_IP_PNP
#include <net/ipconfig.h> #include <net/ipconfig.h>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/setup.h>
#include "mach.h" #include "mach.h"
...@@ -63,8 +64,8 @@ void __init setup_arch (char **cmdline) ...@@ -63,8 +64,8 @@ void __init setup_arch (char **cmdline)
{ {
/* Keep a copy of command line */ /* Keep a copy of command line */
*cmdline = command_line; *cmdline = command_line;
memcpy (saved_command_line, command_line, sizeof saved_command_line); memcpy (saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[sizeof saved_command_line - 1] = '\0'; saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
console_verbose (); console_verbose ();
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/bootsetup.h> #include <asm/bootsetup.h>
#include <asm/setup.h>
/* Don't add a printk in there. printk relies on the PDA which is not initialized /* Don't add a printk in there. printk relies on the PDA which is not initialized
yet. */ yet. */
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <asm/bootsetup.h> #include <asm/bootsetup.h>
#include <asm/smp.h> #include <asm/smp.h>
#include <asm/proto.h> #include <asm/proto.h>
#include <asm/setup.h>
/* /*
* Machine setup.. * Machine setup..
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include <linux/config.h> #include <linux/config.h>
#include <linux/compiler.h> #include <linux/compiler.h>
#include <asm/setup.h>
/* These macros are used to mark some functions or /* These macros are used to mark some functions or
* initialized data (doesn't apply to uninitialized data) * initialized data (doesn't apply to uninitialized data)
...@@ -69,7 +68,7 @@ extern initcall_t __con_initcall_start, __con_initcall_end; ...@@ -69,7 +68,7 @@ extern initcall_t __con_initcall_start, __con_initcall_end;
extern initcall_t __security_initcall_start, __security_initcall_end; extern initcall_t __security_initcall_start, __security_initcall_end;
/* Defined in init/main.c */ /* Defined in init/main.c */
extern char saved_command_line[COMMAND_LINE_SIZE]; extern char saved_command_line[];
#endif #endif
#ifndef MODULE #ifndef MODULE
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/bugs.h> #include <asm/bugs.h>
#include <asm/setup.h>
/* /*
* This is one of the first .c files built. Error out early * This is one of the first .c files built. Error out early
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment