Commit 5b80287a authored by Yaowei Bai's avatar Yaowei Bai Committed by Linus Torvalds

mm/mmzone.c: memmap_valid_within() can be boolean

Make memmap_valid_within return bool due to this particular function
only using either one or zero as its return value.

No functional change.
Signed-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 6219c2a2
......@@ -1200,13 +1200,13 @@ unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
* the zone and PFN linkages are still valid. This is expensive, but walkers
* of the full memmap are extremely rare.
*/
int memmap_valid_within(unsigned long pfn,
bool memmap_valid_within(unsigned long pfn,
struct page *page, struct zone *zone);
#else
static inline int memmap_valid_within(unsigned long pfn,
static inline bool memmap_valid_within(unsigned long pfn,
struct page *page, struct zone *zone)
{
return 1;
return true;
}
#endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */
......
......@@ -72,16 +72,16 @@ struct zoneref *next_zones_zonelist(struct zoneref *z,
}
#ifdef CONFIG_ARCH_HAS_HOLES_MEMORYMODEL
int memmap_valid_within(unsigned long pfn,
bool memmap_valid_within(unsigned long pfn,
struct page *page, struct zone *zone)
{
if (page_to_pfn(page) != pfn)
return 0;
return false;
if (page_zone(page) != zone)
return 0;
return false;
return 1;
return true;
}
#endif /* CONFIG_ARCH_HAS_HOLES_MEMORYMODEL */
......
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