summaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorChanho Min2016-05-20 02:11:57 +0200
committerLinus Torvalds2016-05-20 04:12:14 +0200
commit29f9cb53d25cd9916537b44b0af7f0b95a2e4438 (patch)
treee3a230c8660143be59b2d0ae4cd5b90a8e385fdd /include/linux/mmzone.h
parentmm, compaction: skip blocks where isolation fails in async direct compaction (diff)
downloadkernel-qcow2-linux-29f9cb53d25cd9916537b44b0af7f0b95a2e4438.tar.gz
kernel-qcow2-linux-29f9cb53d25cd9916537b44b0af7f0b95a2e4438.tar.xz
kernel-qcow2-linux-29f9cb53d25cd9916537b44b0af7f0b95a2e4438.zip
mm/highmem: simplify is_highmem()
is_highmem() can be simplified by use of is_highmem_idx(). This patch removes redundant code and will make it easier to maintain if the zone policy is changed or a new zone is added. (akpm: saves me 25 bytes of text per is_highmem() callsite) Signed-off-by: Chanho Min <chanho.min@lge.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com> Cc: Michal Hocko <mhocko@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c60df9257cc7..150c6049f961 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -828,10 +828,7 @@ static inline int is_highmem_idx(enum zone_type idx)
static inline int is_highmem(struct zone *zone)
{
#ifdef CONFIG_HIGHMEM
- int zone_off = (char *)zone - (char *)zone->zone_pgdat->node_zones;
- return zone_off == ZONE_HIGHMEM * sizeof(*zone) ||
- (zone_off == ZONE_MOVABLE * sizeof(*zone) &&
- zone_movable_is_highmem());
+ return is_highmem_idx(zone_idx(zone));
#else
return 0;
#endif