]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
init/main.c: use memblock apis for early memory allocations
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Tue, 21 Jan 2014 23:50:21 +0000 (15:50 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Jan 2014 00:19:46 +0000 (16:19 -0800)
Switch to memblock interfaces for early memory allocator instead of
bootmem allocator.  No functional change in beahvior than what it is in
current code from bootmem users points of view.

Archs already converted to NO_BOOTMEM now directly use memblock
interfaces instead of bootmem wrappers build on top of memblock.  And
the archs which still uses bootmem, these new apis just fall back to
exiting bootmem APIs.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/main.c

index 01573fdfa1868fd7fb320d472eff6217f39a07eb..f865261fb096ee9a3382e898017a9b8f10bdc02c 100644 (file)
@@ -355,9 +355,11 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { }
  */
 static void __init setup_command_line(char *command_line)
 {
-       saved_command_line = alloc_bootmem(strlen (boot_command_line)+1);
-       initcall_command_line = alloc_bootmem(strlen (boot_command_line)+1);
-       static_command_line = alloc_bootmem(strlen (command_line)+1);
+       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);
        strcpy (saved_command_line, boot_command_line);
        strcpy (static_command_line, command_line);
 }