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 @@
#include <linux/reboot.h>
#endif
#include <linux/notifier.h>
#include <asm/setup.h>
#include <asm/io.h>
extern struct notifier_block *panic_notifier_list;
......
......@@ -18,6 +18,8 @@
#include <linux/seq_file.h>
#include <linux/tty.h>
#include <asm/setup.h>
/*
* Setup options
*/
......
......@@ -155,8 +155,8 @@ void __init setup_arch(char **cmdline_p)
#endif
/* Keep a copy of command line */
*cmdline_p = &command_line[0];
memcpy(saved_command_line, command_line, sizeof(saved_command_line));
saved_command_line[sizeof(saved_command_line)-1] = 0;
memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[COMMAND_LINE_SIZE-1] = 0;
#ifdef DEBUG
if (strlen(*cmdline_p))
......
......@@ -47,6 +47,7 @@
#include <asm/sal.h>
#include <asm/sections.h>
#include <asm/serial.h>
#include <asm/setup.h>
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/unistd.h>
......@@ -284,7 +285,7 @@ setup_arch (char **cmdline_p)
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
*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();
io_port_init();
......
......@@ -216,8 +216,8 @@ void setup_arch(char **cmdline_p)
/* Keep a copy of command line */
*cmdline_p = &command_line[0];
memcpy(saved_command_line, command_line, sizeof(saved_command_line));
saved_command_line[sizeof(saved_command_line)-1] = 0;
memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[COMMAND_LINE_SIZE-1] = 0;
#ifdef DEBUG
if (strlen(*cmdline_p))
......
......@@ -38,6 +38,7 @@
#include <asm/bootinfo.h>
#include <asm/cpu.h>
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/system.h>
struct cpuinfo_mips cpu_data[NR_CPUS];
......@@ -489,7 +490,7 @@ void __init setup_arch(char **cmdline_p)
do_earlyinitcalls();
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;
......
......@@ -44,6 +44,7 @@
#include <asm/machdep.h> /* for pa7300lc_init() proto */
#include <asm/pdc_chassis.h>
#include <asm/io.h>
#include <asm/setup.h>
char command_line[COMMAND_LINE_SIZE];
......
......@@ -676,7 +676,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.brk = (unsigned long) klimit;
/* 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;
/* set up the bootmem stuff with available memory */
......
......@@ -44,6 +44,7 @@
#include <asm/sections.h>
#include <asm/btext.h>
#include <asm/nvram.h>
#include <asm/setup.h>
#include <asm/system.h>
extern unsigned long klimit;
......@@ -629,7 +630,7 @@ void __init setup_arch(char **cmdline_p)
init_mm.brk = klimit;
/* 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;
irqstack_early_init();
......
......@@ -25,6 +25,7 @@
#include <asm/io_generic.h>
#include <asm/sections.h>
#include <asm/irq.h>
#include <asm/setup.h>
#ifdef CONFIG_SH_KGDB
#include <asm/kgdb.h>
......
......@@ -47,6 +47,7 @@
#include <asm/hardirq.h>
#include <asm/machines.h>
#include <asm/cpudata.h>
#include <asm/setup.h>
struct screen_info screen_info = {
0, 0, /* orig-x, orig-y */
......
......@@ -47,6 +47,7 @@
#include <asm/mmu_context.h>
#include <asm/timer.h>
#include <asm/sections.h>
#include <asm/setup.h>
#ifdef CONFIG_IP_PNP
#include <net/ipconfig.h>
......
......@@ -23,6 +23,7 @@
#include <linux/init.h>
#include <asm/irq.h>
#include <asm/setup.h>
#include "mach.h"
......@@ -63,8 +64,8 @@ void __init setup_arch (char **cmdline)
{
/* Keep a copy of command line */
*cmdline = command_line;
memcpy (saved_command_line, command_line, sizeof saved_command_line);
saved_command_line[sizeof saved_command_line - 1] = '\0';
memcpy (saved_command_line, command_line, COMMAND_LINE_SIZE);
saved_command_line[COMMAND_LINE_SIZE - 1] = '\0';
console_verbose ();
......
......@@ -16,6 +16,7 @@
#include <asm/proto.h>
#include <asm/smp.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
yet. */
......
......@@ -55,6 +55,7 @@
#include <asm/bootsetup.h>
#include <asm/smp.h>
#include <asm/proto.h>
#include <asm/setup.h>
/*
* Machine setup..
......
......@@ -3,7 +3,6 @@
#include <linux/config.h>
#include <linux/compiler.h>
#include <asm/setup.h>
/* These macros are used to mark some functions or
* initialized data (doesn't apply to uninitialized data)
......@@ -69,7 +68,7 @@ extern initcall_t __con_initcall_start, __con_initcall_end;
extern initcall_t __security_initcall_start, __security_initcall_end;
/* Defined in init/main.c */
extern char saved_command_line[COMMAND_LINE_SIZE];
extern char saved_command_line[];
#endif
#ifndef MODULE
......
......@@ -47,6 +47,7 @@
#include <asm/io.h>
#include <asm/bugs.h>
#include <asm/setup.h>
/*
* 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