]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kernel/printk/printk.c: use memblock apis for early memory allocations
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Fri, 3 Jan 2014 03:09:54 +0000 (14:09 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:09:54 +0000 (14:09 +1100)
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 fallback to exiting bootmem APIs.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
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: 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>
kernel/printk/printk.c

index be7c86bae5762e4e5283dcbd305951301310c58d..f8b41bddc6dcd54d31af4625306177c6cb6b22f3 100644 (file)
@@ -757,14 +757,10 @@ void __init setup_log_buf(int early)
                return;
 
        if (early) {
-               unsigned long mem;
-
-               mem = memblock_alloc(new_log_buf_len, PAGE_SIZE);
-               if (!mem)
-                       return;
-               new_log_buf = __va(mem);
+               new_log_buf =
+                       memblock_virt_alloc(new_log_buf_len, PAGE_SIZE);
        } else {
-               new_log_buf = alloc_bootmem_nopanic(new_log_buf_len);
+               new_log_buf = memblock_virt_alloc_nopanic(new_log_buf_len, 0);
        }
 
        if (unlikely(!new_log_buf)) {