Skip to content

Commit 3cd7d78

Browse files
Yaowei BaiAKASHI Takahiro
authored andcommitted
mm/memblock.c: memblock_is_memory()/reserved() can be boolean
Make memblock_is_memory() and memblock_is_reserved return bool to improve readability due to these particular functions only using either one or zero as their return value. No functional change. Signed-off-by: Yaowei Bai <baiyaowei@cmss.chinamobile.com> Acked-by: Michal Hocko <mhocko@suse.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 02dd189 commit 3cd7d78

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/linux/memblock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ phys_addr_t memblock_mem_size(unsigned long limit_pfn);
325325
phys_addr_t memblock_start_of_DRAM(void);
326326
phys_addr_t memblock_end_of_DRAM(void);
327327
void memblock_enforce_memory_limit(phys_addr_t memory_limit);
328-
int memblock_is_memory(phys_addr_t addr);
328+
bool memblock_is_memory(phys_addr_t addr);
329329
int memblock_is_map_memory(phys_addr_t addr);
330330
int memblock_is_region_memory(phys_addr_t base, phys_addr_t size);
331-
int memblock_is_reserved(phys_addr_t addr);
331+
bool memblock_is_reserved(phys_addr_t addr);
332332
bool memblock_is_region_reserved(phys_addr_t base, phys_addr_t size);
333333

334334
extern void __memblock_dump_all(void);

mm/memblock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,12 +1528,12 @@ static int __init_memblock memblock_search(struct memblock_type *type, phys_addr
15281528
return -1;
15291529
}
15301530

1531-
int __init memblock_is_reserved(phys_addr_t addr)
1531+
bool __init memblock_is_reserved(phys_addr_t addr)
15321532
{
15331533
return memblock_search(&memblock.reserved, addr) != -1;
15341534
}
15351535

1536-
int __init_memblock memblock_is_memory(phys_addr_t addr)
1536+
bool __init_memblock memblock_is_memory(phys_addr_t addr)
15371537
{
15381538
return memblock_search(&memblock.memory, addr) != -1;
15391539
}

0 commit comments

Comments
 (0)