Commit 5d63f81c authored by Miles Chen's avatar Miles Chen Committed by Linus Torvalds

mm/memblock.c: remove unnecessary log and clean up

There is no variable named flags in memblock_add() and
memblock_reserve() so remove it from the log messages.

This patch also cleans up the type casting for phys_addr_t by using %pa
to print them.

Link: http://lkml.kernel.org/r/1484720165-25403-1-git-send-email-miles.chen@mediatek.comSigned-off-by: default avatarMiles Chen <miles.chen@mediatek.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 23519073
...@@ -611,10 +611,10 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size, ...@@ -611,10 +611,10 @@ int __init_memblock memblock_add_node(phys_addr_t base, phys_addr_t size,
int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size) int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size)
{ {
memblock_dbg("memblock_add: [%#016llx-%#016llx] flags %#02lx %pF\n", phys_addr_t end = base + size - 1;
(unsigned long long)base,
(unsigned long long)base + size - 1, memblock_dbg("memblock_add: [%pa-%pa] %pF\n",
0UL, (void *)_RET_IP_); &base, &end, (void *)_RET_IP_);
return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0); return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0);
} }
...@@ -718,10 +718,10 @@ int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size) ...@@ -718,10 +718,10 @@ int __init_memblock memblock_remove(phys_addr_t base, phys_addr_t size)
int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
{ {
memblock_dbg(" memblock_free: [%#016llx-%#016llx] %pF\n", phys_addr_t end = base + size - 1;
(unsigned long long)base,
(unsigned long long)base + size - 1, memblock_dbg(" memblock_free: [%pa-%pa] %pF\n",
(void *)_RET_IP_); &base, &end, (void *)_RET_IP_);
kmemleak_free_part_phys(base, size); kmemleak_free_part_phys(base, size);
return memblock_remove_range(&memblock.reserved, base, size); return memblock_remove_range(&memblock.reserved, base, size);
...@@ -729,10 +729,10 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) ...@@ -729,10 +729,10 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size)
int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size) int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size)
{ {
memblock_dbg("memblock_reserve: [%#016llx-%#016llx] flags %#02lx %pF\n", phys_addr_t end = base + size - 1;
(unsigned long long)base,
(unsigned long long)base + size - 1, memblock_dbg("memblock_reserve: [%pa-%pa] %pF\n",
0UL, (void *)_RET_IP_); &base, &end, (void *)_RET_IP_);
return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0); return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0);
} }
...@@ -1227,8 +1227,8 @@ phys_addr_t __init memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys ...@@ -1227,8 +1227,8 @@ phys_addr_t __init memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys
alloc = __memblock_alloc_base(size, align, max_addr); alloc = __memblock_alloc_base(size, align, max_addr);
if (alloc == 0) if (alloc == 0)
panic("ERROR: Failed to allocate 0x%llx bytes below 0x%llx.\n", panic("ERROR: Failed to allocate %pa bytes below %pa.\n",
(unsigned long long) size, (unsigned long long) max_addr); &size, &max_addr);
return alloc; return alloc;
} }
...@@ -1695,7 +1695,7 @@ phys_addr_t __init_memblock memblock_get_current_limit(void) ...@@ -1695,7 +1695,7 @@ phys_addr_t __init_memblock memblock_get_current_limit(void)
static void __init_memblock memblock_dump(struct memblock_type *type, char *name) static void __init_memblock memblock_dump(struct memblock_type *type, char *name)
{ {
unsigned long long base, size; phys_addr_t base, end, size;
unsigned long flags; unsigned long flags;
int idx; int idx;
struct memblock_region *rgn; struct memblock_region *rgn;
...@@ -1707,23 +1707,24 @@ static void __init_memblock memblock_dump(struct memblock_type *type, char *name ...@@ -1707,23 +1707,24 @@ static void __init_memblock memblock_dump(struct memblock_type *type, char *name
base = rgn->base; base = rgn->base;
size = rgn->size; size = rgn->size;
end = base + size - 1;
flags = rgn->flags; flags = rgn->flags;
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
if (memblock_get_region_node(rgn) != MAX_NUMNODES) if (memblock_get_region_node(rgn) != MAX_NUMNODES)
snprintf(nid_buf, sizeof(nid_buf), " on node %d", snprintf(nid_buf, sizeof(nid_buf), " on node %d",
memblock_get_region_node(rgn)); memblock_get_region_node(rgn));
#endif #endif
pr_info(" %s[%#x]\t[%#016llx-%#016llx], %#llx bytes%s flags: %#lx\n", pr_info(" %s[%#x]\t[%pa-%pa], %pa bytes%s flags: %#lx\n",
name, idx, base, base + size - 1, size, nid_buf, flags); name, idx, &base, &end, &size, nid_buf, flags);
} }
} }
void __init_memblock __memblock_dump_all(void) void __init_memblock __memblock_dump_all(void)
{ {
pr_info("MEMBLOCK configuration:\n"); pr_info("MEMBLOCK configuration:\n");
pr_info(" memory size = %#llx reserved size = %#llx\n", pr_info(" memory size = %pa reserved size = %pa\n",
(unsigned long long)memblock.memory.total_size, &memblock.memory.total_size,
(unsigned long long)memblock.reserved.total_size); &memblock.reserved.total_size);
memblock_dump(&memblock.memory, "memory"); memblock_dump(&memblock.memory, "memory");
memblock_dump(&memblock.reserved, "reserved"); memblock_dump(&memblock.reserved, "reserved");
...@@ -1749,19 +1750,14 @@ static int memblock_debug_show(struct seq_file *m, void *private) ...@@ -1749,19 +1750,14 @@ static int memblock_debug_show(struct seq_file *m, void *private)
struct memblock_type *type = m->private; struct memblock_type *type = m->private;
struct memblock_region *reg; struct memblock_region *reg;
int i; int i;
phys_addr_t end;
for (i = 0; i < type->cnt; i++) { for (i = 0; i < type->cnt; i++) {
reg = &type->regions[i]; reg = &type->regions[i];
seq_printf(m, "%4d: ", i); end = reg->base + reg->size - 1;
if (sizeof(phys_addr_t) == 4)
seq_printf(m, "0x%08lx..0x%08lx\n",
(unsigned long)reg->base,
(unsigned long)(reg->base + reg->size - 1));
else
seq_printf(m, "0x%016llx..0x%016llx\n",
(unsigned long long)reg->base,
(unsigned long long)(reg->base + reg->size - 1));
seq_printf(m, "%4d: ", i);
seq_printf(m, "%pa..%pa\n", &reg->base, &end);
} }
return 0; return 0;
} }
......
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