From: YueHaibing <yuehaibing@huawei.com>
To: <akpm@linux-foundation.org>, <sfr@canb.auug.org.au>, <osalvador@suse.de>
Cc: <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH -next] mm/memory_hotplug: Fix build warning without CONFIG_MEMORY_HOTREMOVE
Date: Fri, 8 Apr 2022 10:24:02 +0800 [thread overview]
Message-ID: <20220408022402.29668-1-yuehaibing@huawei.com> (raw)
mm/memory_hotplug.c:1148:13: warning: ‘reset_node_present_pages’ defined but not used [-Wunused-function]
1148 | static void reset_node_present_pages(pg_data_t *pgdat)
| ^~~~~~~~~~~~~~~~~~~~~~~~
reset_node_present_pages() now only used in node_reset_state(),move it
inside the ifdef block to fix this warning.
Fixes: 0d540af7befe ("mm/memory_hotplug: reset node's state when empty during offline")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
mm/memory_hotplug.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 74430f88853d..925359655f4d 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -1145,16 +1145,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
return ret;
}
-static void reset_node_present_pages(pg_data_t *pgdat)
-{
- struct zone *z;
-
- for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++)
- z->present_pages = 0;
-
- pgdat->node_present_pages = 0;
-}
-
static void hotadd_init_pgdat(int nid)
{
struct pglist_data *pgdat = NODE_DATA(nid);
@@ -1748,6 +1738,16 @@ static void node_states_clear_node(int node, struct memory_notify *arg)
node_clear_state(node, N_MEMORY);
}
+static void reset_node_present_pages(pg_data_t *pgdat)
+{
+ struct zone *z;
+
+ for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++)
+ z->present_pages = 0;
+
+ pgdat->node_present_pages = 0;
+}
+
static void node_reset_state(int node)
{
pg_data_t *pgdat = NODE_DATA(node);
--
2.17.1
reply other threads:[~2022-04-08 2:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220408022402.29668-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=osalvador@suse.de \
--cc=sfr@canb.auug.org.au \
/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