Skip to content

Commit

Permalink
mm: refactor zone_movable_is_highmem()
Browse files Browse the repository at this point in the history
All callers of zone_movable_is_highmem are under #ifdef CONFIG_HIGHMEM,
so the else branch return 0 is not needed.

Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Zhang Zhen authored and Linus Torvalds committed Apr 15, 2015
1 parent bdddbcd commit d7e4a2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/linux/mmzone.h
Original file line number Diff line number Diff line change
Expand Up @@ -842,16 +842,16 @@ static inline int populated_zone(struct zone *zone)

extern int movable_zone;

#ifdef CONFIG_HIGHMEM
static inline int zone_movable_is_highmem(void)
{
#if defined(CONFIG_HIGHMEM) && defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP)
#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
return movable_zone == ZONE_HIGHMEM;
#elif defined(CONFIG_HIGHMEM)
return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM;
#else
return 0;
return (ZONE_MOVABLE - 1) == ZONE_HIGHMEM;
#endif
}
#endif

static inline int is_highmem_idx(enum zone_type idx)
{
Expand Down

0 comments on commit d7e4a2e

Please sign in to comment.