@@ -505,8 +505,7 @@ register_cpus(void)
arch_initcall(register_cpus);
-void __init
-setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
extern char _end[];
@@ -566,7 +565,6 @@ setup_arch(char **cmdline_p)
strlcpy(command_line, COMMAND_LINE, sizeof command_line);
}
strcpy(boot_command_line, command_line);
- *cmdline_p = command_line;
/*
* Process command-line arguments.
@@ -456,7 +456,7 @@ static inline int is_kernel(unsigned long addr)
return 0;
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
#ifdef CONFIG_ARC_UBOOT_SUPPORT
/* make sure that uboot passed pointer to cmdline/dtb is valid */
@@ -487,9 +487,6 @@ void __init setup_arch(char **cmdline_p)
}
}
- /* Save unparsed command line copy for /proc/cmdline */
- *cmdline_p = boot_command_line;
-
/* To force early parsing of things like mem=xxx */
parse_early_param();
@@ -153,7 +153,6 @@ EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
static const char *machine_name;
-static char __initdata cmd_line[COMMAND_LINE_SIZE];
const struct machine_desc *machine_desc __initdata;
static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -1061,7 +1060,7 @@ void __init hyp_mode_check(void)
#endif
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
const struct machine_desc *mdesc;
@@ -1091,10 +1090,6 @@ void __init setup_arch(char **cmdline_p)
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) _end;
- /* populate cmd_line too for later use, preserving boot_command_line */
- strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
- *cmdline_p = cmd_line;
-
early_fixmap_init();
early_ioremap_init();
@@ -243,15 +243,13 @@ static void __init request_standard_resources(void)
u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
init_mm.start_code = (unsigned long) _text;
init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata;
init_mm.brk = (unsigned long) _end;
- *cmdline_p = boot_command_line;
-
early_fixmap_init();
early_ioremap_init();
@@ -294,16 +294,13 @@ notrace void __init machine_init(unsigned long dt_ptr)
parse_early_param();
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
int bootmap_size;
struct memblock_region *reg;
printk(KERN_INFO "Initializing kernel\n");
- /* Initialize command line */
- *cmdline_p = boot_command_line;
-
memory_end = ram_end;
memory_end &= ~(PAGE_SIZE - 1);
@@ -117,7 +117,7 @@ static void __init bootmem_init(void)
}
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
unflatten_and_copy_device_tree();
@@ -131,7 +131,6 @@ void __init setup_arch(char **cmdline_p)
if (*command_line)
strcpy(boot_command_line, command_line);
- *cmdline_p = boot_command_line;
parse_early_param();
@@ -34,7 +34,6 @@
#include <asm/vm_mmu.h>
#include <asm/time.h>
-char cmd_line[COMMAND_LINE_SIZE];
static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
int on_simulator;
@@ -44,12 +43,7 @@ void calibrate_delay(void)
loops_per_jiffy = thread_freq_mhz * 1000000 / HZ;
}
-/*
- * setup_arch - high level architectural setup routine
- * @cmdline_p: pointer to pointer to command-line arguments
- */
-
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
char *p = &external_cmdline_buffer;
@@ -84,14 +78,6 @@ void __init setup_arch(char **cmdline_p)
strlcpy(boot_command_line, default_command_line,
COMMAND_LINE_SIZE);
- /*
- * boot_command_line and the value set up by setup_arch
- * are both picked up by the init code. If no reason to
- * make them different, pass the same pointer back.
- */
- strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
- *cmdline_p = cmd_line;
-
parse_early_param();
setup_arch_memory();
@@ -527,15 +527,16 @@ int __init reserve_elfcorehdr(u64 *start, u64 *end)
#endif /* CONFIG_PROC_VMCORE */
-void __init
-setup_arch (char **cmdline_p)
+void __init setup_arch (void)
{
+ char *cmdline_p;
+
unw_init();
ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
- *cmdline_p = __va(ia64_boot_param->command_line);
- strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+ cmdline_p = __va(ia64_boot_param->command_line);
+ strlcpy(boot_command_line, cmdline_p, COMMAND_LINE_SIZE);
efi_init();
io_port_init();
@@ -546,12 +547,12 @@ setup_arch (char **cmdline_p)
* that ia64_mv is initialised before any command line
* settings may cause console setup to occur
*/
- machvec_init_from_cmdline(*cmdline_p);
+ machvec_init_from_cmdline(cmdline_p);
#endif
parse_early_param();
- if (early_console_setup(*cmdline_p) == 0)
+ if (early_console_setup(cmdline_p) == 0)
mark_bsp_online();
#ifdef CONFIG_ACPI
@@ -618,7 +619,7 @@ setup_arch (char **cmdline_p)
if (!nomca)
ia64_mca_init();
- platform_setup(cmdline_p);
+ platform_setup(&cmdline_p);
#ifndef CONFIG_IA64_HP_SIM
check_sal_cache_flush();
#endif
@@ -222,7 +222,7 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
#endif
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
#ifndef CONFIG_SUN3
int i;
@@ -272,8 +272,7 @@ void __init setup_arch(char **cmdline_p)
m68k_command_line[CL_SIZE - 1] = 0;
#endif /* CONFIG_BOOTPARAM */
process_uboot_commandline(&m68k_command_line[0], CL_SIZE);
- *cmdline_p = m68k_command_line;
- memcpy(boot_command_line, *cmdline_p, CL_SIZE);
+ memcpy(boot_command_line, m68k_command_line, CL_SIZE);
parse_early_param();
@@ -84,7 +84,7 @@ void (*mach_power_off)(void);
#define CPU_INSTR_PER_JIFFY 16
#endif
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
int bootmap_size;
@@ -143,7 +143,6 @@ void __init setup_arch(char **cmdline_p)
__bss_stop, memory_start, memory_start, memory_end);
/* Keep a copy of command line */
- *cmdline_p = &command_line[0];
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
boot_command_line[COMMAND_LINE_SIZE-1] = 0;
@@ -50,10 +50,8 @@ unsigned int boot_cpuid;
*/
char cmd_line[COMMAND_LINE_SIZE] __attribute__ ((section(".data")));
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
- *cmdline_p = boot_command_line;
-
console_verbose();
unflatten_device_tree();
@@ -64,7 +64,6 @@ EXPORT_SYMBOL(mips_machtype);
struct boot_mem_map boot_mem_map;
-static char __initdata command_line[COMMAND_LINE_SIZE];
char __initdata arcs_cmdline[COMMAND_LINE_SIZE];
#ifdef CONFIG_CMDLINE_BOOL
@@ -829,7 +828,7 @@ static void __init request_crashkernel(struct resource *res)
#define BUILTIN_EXTEND_WITH_PROM \
IS_ENABLED(CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND)
-static void __init arch_mem_init(char **cmdline_p)
+static void __init arch_mem_init(void)
{
struct memblock_region *reg;
extern void plat_mem_setup(void);
@@ -881,10 +880,6 @@ static void __init arch_mem_init(char **cmdline_p)
pr_info("Determined physical RAM map:\n");
print_memory_map();
- strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
-
- *cmdline_p = command_line;
-
parse_early_param();
if (usermem) {
@@ -1002,7 +997,7 @@ static void __init prefill_possible_map(void)
static inline void prefill_possible_map(void) {}
#endif
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
cpu_probe();
mips_cm_probe();
@@ -1023,7 +1018,7 @@ void __init setup_arch(char **cmdline_p)
#endif
#endif
- arch_mem_init(cmdline_p);
+ arch_mem_init();
resource_init();
plat_smp_setup();
@@ -276,7 +276,7 @@ static void __init setup_memory(void)
memblock_dump_all();
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
early_init_devtree( __dtb_start);
@@ -303,7 +303,6 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
}
- *cmdline_p = boot_command_line;
early_trap_init();
}
@@ -141,7 +141,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
parse_early_param();
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
int bootmap_size;
@@ -156,9 +156,6 @@ void __init setup_arch(char **cmdline_p)
init_mm.brk = (unsigned long) _end;
init_task.thread.kregs = &fake_regs;
- /* Keep a copy of command line */
- *cmdline_p = boot_command_line;
-
min_low_pfn = PFN_UP(memory_start);
max_low_pfn = PFN_DOWN(memory_end);
max_mapnr = max_low_pfn;
@@ -283,7 +283,7 @@ void calibrate_delay(void)
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
unflatten_and_copy_device_tree();
@@ -320,8 +320,6 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif
- *cmdline_p = boot_command_line;
-
printk(KERN_INFO "OpenRISC Linux -- http://openrisc.io\n");
}
@@ -51,8 +51,6 @@
#include <asm/unwind.h>
#include <asm/smp.h>
-static char __initdata command_line[COMMAND_LINE_SIZE];
-
/* Intended for ccio/sba/cpu statistics under /proc/bus/{runway|gsc} */
struct proc_dir_entry * proc_runway_root __read_mostly = NULL;
struct proc_dir_entry * proc_gsc_root __read_mostly = NULL;
@@ -63,7 +61,7 @@ int parisc_bus_is_phys __read_mostly = 1; /* Assume no IOMMU is present */
EXPORT_SYMBOL(parisc_bus_is_phys);
#endif
-void __init setup_cmdline(char **cmdline_p)
+void __init setup_cmdline(void)
{
extern unsigned int boot_args[];
@@ -85,9 +83,6 @@ void __init setup_cmdline(char **cmdline_p)
}
#endif
}
-
- strcpy(command_line, boot_command_line);
- *cmdline_p = command_line;
}
#ifdef CONFIG_PA11
@@ -119,7 +114,7 @@ void __init dma_ops_init(void)
extern void collect_boot_cpu_data(void);
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
#ifdef CONFIG_64BIT
extern int parisc_narrow_firmware;
@@ -839,10 +839,8 @@ static __init void print_system_info(void)
* Called into from start_kernel this initializes memblock, which is used
* to manage page allocation until mem_init is called.
*/
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
- *cmdline_p = boot_command_line;
-
/* Set a half-reasonable default so udelay does something sensible */
loops_per_jiffy = 500000000 / HZ;
@@ -192,10 +192,8 @@ static void __init setup_bootmem(void)
}
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
- *cmdline_p = boot_command_line;
-
parse_early_param();
init_mm.start_code = (unsigned long) _stext;
@@ -867,7 +867,7 @@ static void __init setup_task_size(void)
* was printed.
*/
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
/*
* print what head.S has found out about the machine
@@ -880,10 +880,6 @@ void __init setup_arch(char **cmdline_p)
else if (MACHINE_IS_LPAR)
pr_info("Linux is running natively in 64-bit mode\n");
- /* Have one command line that is parsed and saved in /proc/cmdline */
- /* boot_command_line has been already set up in early.c */
- *cmdline_p = boot_command_line;
-
ROOT_DEV = Root_RAM0;
/* Is init_mm really needed? */
@@ -270,8 +270,10 @@ void __ref sh_fdt_init(phys_addr_t dt_phys)
}
#endif
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
+ char *cmdline_p = command_line;
+
enable_mmu();
ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
@@ -319,7 +321,6 @@ void __init setup_arch(char **cmdline_p)
/* Save unparsed command line copy for /proc/cmdline */
memcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
- *cmdline_p = command_line;
parse_early_param();
@@ -338,7 +339,7 @@ void __init setup_arch(char **cmdline_p)
/* Perform the machine specific initialisation */
if (likely(sh_mv.mv_setup))
- sh_mv.mv_setup(cmdline_p);
+ sh_mv.mv_setup(&cmdline_p);
plat_smp_setup();
}
@@ -294,19 +294,20 @@ void __init sparc32_start_kernel(struct linux_romvec *rp)
start_kernel();
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
int i;
+ char *cmdline_p;
unsigned long highest_paddr;
sparc_ttable = &trapbase;
/* Initialize PROM console and command line. */
- *cmdline_p = prom_getbootargs();
- strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+ cmdline_p = prom_getbootargs();
+ strlcpy(boot_command_line, cmdline_p, COMMAND_LINE_SIZE);
parse_early_param();
- boot_flags_init(*cmdline_p);
+ boot_flags_init(cmdline_p);
register_console(&prom_early_console);
@@ -630,14 +630,14 @@ void __init alloc_irqstack_bootmem(void)
}
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
/* Initialize PROM console and command line. */
- *cmdline_p = prom_getbootargs();
- strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+ char *cmdline_p = prom_getbootargs();
+ strlcpy(boot_command_line, cmdline_p, COMMAND_LINE_SIZE);
parse_early_param();
- boot_flags_init(*cmdline_p);
+ boot_flags_init(cmdline_p);
#ifdef CONFIG_EARLYFB
if (btext_find_display())
#endif
@@ -339,7 +339,7 @@ int __init __weak read_initrd(void)
return 0;
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
stack_protections((unsigned long) &init_thread_info);
setup_physmem(uml_physmem, uml_reserved, physmem_size, highmem);
@@ -348,7 +348,6 @@ void __init setup_arch(char **cmdline_p)
paging_init();
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
- *cmdline_p = command_line;
setup_hostinfo(host_info, sizeof host_info);
}
@@ -60,8 +60,6 @@ struct screen_info screen_info;
char elf_platform[ELF_PLATFORM_SIZE];
EXPORT_SYMBOL(elf_platform);
-static char __initdata cmd_line[COMMAND_LINE_SIZE];
-
static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
/*
@@ -235,7 +233,7 @@ static int __init customize_machine(void)
}
arch_initcall(customize_machine);
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
char *from = default_command_line;
@@ -249,10 +247,6 @@ void __init setup_arch(char **cmdline_p)
/* parse_early_param needs a boot_command_line */
strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
- /* populate cmd_line too for later use, preserving boot_command_line */
- strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
- *cmdline_p = cmd_line;
-
parse_early_param();
uc32_memblock_init(&meminfo);
@@ -219,7 +219,6 @@ unsigned long saved_video_mode;
#define RAMDISK_PROMPT_FLAG 0x8000
#define RAMDISK_LOAD_FLAG 0x4000
-static char __initdata command_line[COMMAND_LINE_SIZE];
#ifdef CONFIG_CMDLINE_BOOL
static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
#endif
@@ -812,7 +811,7 @@ dump_kernel_offset(struct notifier_block *self, unsigned long v, void *p)
* Note: On x86_64, fixmaps are ready for use even before this is called.
*/
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
memblock_reserve(__pa_symbol(_text),
(unsigned long)__bss_stop - (unsigned long)_text);
@@ -933,9 +932,6 @@ void __init setup_arch(char **cmdline_p)
#endif
#endif
- strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
- *cmdline_p = command_line;
-
/*
* x86_configure_nx() is called before parse_early_param() to detect
* whether hardware doesn't support NX (so that the early EHCI debug
@@ -309,8 +309,10 @@ static inline int mem_reserve(unsigned long start, unsigned long end)
return memblock_reserve(start, end - start);
}
-void __init setup_arch(char **cmdline_p)
+void __init setup_arch(void)
{
+ char *cmdline_p = command_line;
+
pr_info("config ID: %08x:%08x\n",
get_sr(SREG_EPC), get_sr(SREG_EXCSAVE));
if (get_sr(SREG_EPC) != XCHAL_HW_CONFIGID0 ||
@@ -318,9 +320,8 @@ void __init setup_arch(char **cmdline_p)
pr_info("built for config ID: %08x:%08x\n",
XCHAL_HW_CONFIGID0, XCHAL_HW_CONFIGID1);
- *cmdline_p = command_line;
- platform_setup(cmdline_p);
- strlcpy(boot_command_line, *cmdline_p, COMMAND_LINE_SIZE);
+ platform_setup(&cmdline_p);
+ strlcpy(boot_command_line, cmdline_p, COMMAND_LINE_SIZE);
/* Reserve some memory regions */
@@ -129,7 +129,7 @@ extern char *saved_command_line;
extern unsigned int reset_devices;
/* used by init/main.c */
-void setup_arch(char **);
+void setup_arch(void);
void prepare_namespace(void);
void __init load_default_modules(void);
int __init init_rootfs(void);
@@ -367,15 +367,16 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
* parsing is performed in place, and we should allow a component to
* store reference of name/value for future reference.
*/
-static void __init setup_command_line(char *command_line)
+static void __init setup_command_line(void)
{
saved_command_line =
memblock_virt_alloc(strlen(boot_command_line) + 1, 0);
initcall_command_line =
memblock_virt_alloc(strlen(boot_command_line) + 1, 0);
- static_command_line = memblock_virt_alloc(strlen(command_line) + 1, 0);
+ static_command_line =
+ memblock_virt_alloc(strlen(boot_command_line) + 1, 0);
strcpy(saved_command_line, boot_command_line);
- strcpy(static_command_line, command_line);
+ strcpy(static_command_line, boot_command_line);
}
/*
@@ -514,7 +515,6 @@ static void __init mm_init(void)
asmlinkage __visible void __init start_kernel(void)
{
- char *command_line;
char *after_dashes;
set_task_stack_end_magic(&init_task);
@@ -533,16 +533,16 @@ asmlinkage __visible void __init start_kernel(void)
boot_cpu_init();
page_address_init();
pr_notice("%s", linux_banner);
- setup_arch(&command_line);
+ setup_arch();
/*
* Set up the the initial canary and entropy after arch
* and after adding latent and command line entropy.
*/
add_latent_entropy();
- add_device_randomness(command_line, strlen(command_line));
+ add_device_randomness(boot_command_line, strlen(boot_command_line));
boot_init_stack_canary();
mm_init_cpumask(&init_mm);
- setup_command_line(command_line);
+ setup_command_line();
setup_nr_cpu_ids();
setup_per_cpu_areas();
boot_cpu_state_init();