Skip to content

Commit

Permalink
mm/mmzone.c: memmap_valid_within() can be boolean
Browse files Browse the repository at this point in the history
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: Yaowei Bai <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Yaowei Bai authored and torvalds committed Jan 15, 2016
1 parent 6219c2a commit 5b80287
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
8 changes: 4 additions & 4 deletions mm/mmzone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit 5b80287

Please sign in to comment.