From 6e4f60570881905ffbe1aadd55be1e806eb81efb Mon Sep 17 00:00:00 2001 From: Alexander Kuleshov Date: Wed, 8 Apr 2015 09:44:35 +1000 Subject: [PATCH] mm/memblock.c: add debug output for memblock_add() memblock_reserve() calls memblock_reserve_region() which prints debugging information if 'memblock=debug' was passed on the command line. This patch adds the same behaviour, but for memblock_add function(). Signed-off-by: Alexander Kuleshov Cc: Martin Schwidefsky Cc: Philipp Hachtmann Cc: Fabian Frederick Cc: Catalin Marinas Cc: Emil Medve Cc: Akinobu Mita Cc: Tang Chen Cc: Tony Luck Signed-off-by: Andrew Morton --- mm/memblock.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mm/memblock.c b/mm/memblock.c index 3f37a0bca5d5..6f8b4544c2de 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -580,10 +580,24 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, return memblock_add_range(&memblock.memory, base, size, nid, 0); } +static int __init_memblock memblock_add_region(phys_addr_t base, + phys_addr_t size, + int nid, + unsigned long flags) +{ + struct memblock_type *_rgn = &memblock.memory; + + memblock_dbg("memblock_memory: [%#016llx-%#016llx] flags %#02lx %pF\n", + (unsigned long long)base, + (unsigned long long)base + size - 1, + flags, (void *)_RET_IP_); + + return memblock_add_range(_rgn, base, size, nid, flags); +} + int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size) { - return memblock_add_range(&memblock.memory, base, size, - MAX_NUMNODES, 0); + return memblock_add_region(base, size, MAX_NUMNODES, 0); } /** -- 2.39.5