aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmzone.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 9f274a687c7e..451eaa13bc28 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -637,9 +637,10 @@ static inline int is_normal_idx(enum zone_type idx)
637static inline int is_highmem(struct zone *zone) 637static inline int is_highmem(struct zone *zone)
638{ 638{
639#ifdef CONFIG_HIGHMEM 639#ifdef CONFIG_HIGHMEM
640 int zone_idx = zone - zone->zone_pgdat->node_zones; 640 int zone_off = (char *)zone - (char *)zone->zone_pgdat->node_zones;
641 return zone_idx == ZONE_HIGHMEM || 641 return zone_off == ZONE_HIGHMEM * sizeof(*zone) ||
642 (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem()); 642 (zone_off == ZONE_MOVABLE * sizeof(*zone) &&
643 zone_movable_is_highmem());
643#else 644#else
644 return 0; 645 return 0;
645#endif 646#endif