From: Zhang Zhen <zhenzhang.zhang@huawei.com>
To: Linux MM <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>,
iamjoonsoo.kim@lge.com
Cc: David Rientjes <rientjes@google.com>,
Dave Hansen <dave.hansen@intel.com>
Subject: [PATCH] mm: refactor zone_movable_is_highmem()
Date: Tue, 10 Mar 2015 15:24:17 +0800 [thread overview]
Message-ID: <54FE9C21.8060107@huawei.com> (raw)
In-Reply-To: <1425972055-53804-1-git-send-email-zhenzhang.zhang@huawei.com>
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>
next parent reply other threads:[~2015-03-10 7:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1425972055-53804-1-git-send-email-zhenzhang.zhang@huawei.com>
2015-03-10 7:24 ` Zhang Zhen [this message]
2015-03-10 19:19 ` David Rientjes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54FE9C21.8060107@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox