* [PATCH] mm: refactor zone_movable_is_highmem()
[not found] <1425972055-53804-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2015-03-10 7:24 ` Zhang Zhen
2015-03-10 19:19 ` David Rientjes
0 siblings, 1 reply; 2+ messages in thread
From: Zhang Zhen @ 2015-03-10 7:24 UTC (permalink / raw)
To: Linux MM, Andrew Morton, iamjoonsoo.kim; +Cc: David Rientjes, Dave Hansen
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>
---
include/linux/mmzone.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f279d9c..218f892 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -843,16 +843,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)
{
--
1.8.5.5
.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 2+ messages in thread