Commit 937f0c26 authored by Yaowei Bai's avatar Yaowei Bai Committed by Linus Torvalds

mm/memblock: memblock_is_map/region_memory can be boolean

Make memblock_is_map/region_memory return bool due to these two
functions only using either true or false as its return value.

No functional change.

Link: http://lkml.kernel.org/r/1513266622-15860-2-git-send-email-baiyaowei@cmss.chinamobile.comSigned-off-by: default avatarYaowei Bai <baiyaowei@cmss.chinamobile.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 22ad3057
...@@ -332,8 +332,8 @@ void memblock_enforce_memory_limit(phys_addr_t memory_limit); ...@@ -332,8 +332,8 @@ void memblock_enforce_memory_limit(phys_addr_t memory_limit);
void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size); void memblock_cap_memory_range(phys_addr_t base, phys_addr_t size);
void memblock_mem_limit_remove_map(phys_addr_t limit); void memblock_mem_limit_remove_map(phys_addr_t limit);
bool memblock_is_memory(phys_addr_t addr); bool memblock_is_memory(phys_addr_t addr);
int memblock_is_map_memory(phys_addr_t addr); bool memblock_is_map_memory(phys_addr_t addr);
int memblock_is_region_memory(phys_addr_t base, phys_addr_t size); bool memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
bool memblock_is_reserved(phys_addr_t addr); bool memblock_is_reserved(phys_addr_t addr);
bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size); bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
......
...@@ -1654,7 +1654,7 @@ bool __init_memblock memblock_is_memory(phys_addr_t addr) ...@@ -1654,7 +1654,7 @@ bool __init_memblock memblock_is_memory(phys_addr_t addr)
return memblock_search(&memblock.memory, addr) != -1; return memblock_search(&memblock.memory, addr) != -1;
} }
int __init_memblock memblock_is_map_memory(phys_addr_t addr) bool __init_memblock memblock_is_map_memory(phys_addr_t addr)
{ {
int i = memblock_search(&memblock.memory, addr); int i = memblock_search(&memblock.memory, addr);
...@@ -1690,13 +1690,13 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn, ...@@ -1690,13 +1690,13 @@ int __init_memblock memblock_search_pfn_nid(unsigned long pfn,
* RETURNS: * RETURNS:
* 0 if false, non-zero if true * 0 if false, non-zero if true
*/ */
int __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size) bool __init_memblock memblock_is_region_memory(phys_addr_t base, phys_addr_t size)
{ {
int idx = memblock_search(&memblock.memory, base); int idx = memblock_search(&memblock.memory, base);
phys_addr_t end = base + memblock_cap_size(base, &size); phys_addr_t end = base + memblock_cap_size(base, &size);
if (idx == -1) if (idx == -1)
return 0; return false;
return (memblock.memory.regions[idx].base + return (memblock.memory.regions[idx].base +
memblock.memory.regions[idx].size) >= end; memblock.memory.regions[idx].size) >= end;
} }
......
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