* [PATCH -next] mm/memory_hotplug: Fix build warning without CONFIG_MEMORY_HOTREMOVE
@ 2022-04-08 2:24 YueHaibing
0 siblings, 0 replies; only message in thread
From: YueHaibing @ 2022-04-08 2:24 UTC (permalink / raw)
To: akpm, sfr, osalvador; +Cc: linux-mm, linux-kernel, YueHaibing
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-04-08 2:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 2:24 [PATCH -next] mm/memory_hotplug: Fix build warning without CONFIG_MEMORY_HOTREMOVE YueHaibing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).