From nobody Fri Jun 19 04:10:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65E55C433F5 for ; Fri, 8 Apr 2022 02:24:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233733AbiDHC0o (ORCPT ); Thu, 7 Apr 2022 22:26:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbiDHC0m (ORCPT ); Thu, 7 Apr 2022 22:26:42 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 945902D9A02 for ; Thu, 7 Apr 2022 19:24:40 -0700 (PDT) Received: from canpemm500007.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KZMWY6BnvzdZR6; Fri, 8 Apr 2022 10:24:09 +0800 (CST) Received: from localhost (10.174.179.215) by canpemm500007.china.huawei.com (7.192.104.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 8 Apr 2022 10:24:38 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH -next] mm/memory_hotplug: Fix build warning without CONFIG_MEMORY_HOTREMOVE Date: Fri, 8 Apr 2022 10:24:02 +0800 Message-ID: <20220408022402.29668-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500007.china.huawei.com (7.192.104.62) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org mm/memory_hotplug.c:1148:13: warning: =E2=80=98reset_node_present_pages=E2= =80=99 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 duri= ng offline") Signed-off-by: YueHaibing --- 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 l= ong nr_pages, return ret; } =20 -static void reset_node_present_pages(pg_data_t *pgdat) -{ - struct zone *z; - - for (z =3D pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++) - z->present_pages =3D 0; - - pgdat->node_present_pages =3D 0; -} - static void hotadd_init_pgdat(int nid) { struct pglist_data *pgdat =3D 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); } =20 +static void reset_node_present_pages(pg_data_t *pgdat) +{ + struct zone *z; + + for (z =3D pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++) + z->present_pages =3D 0; + + pgdat->node_present_pages =3D 0; +} + static void node_reset_state(int node) { pg_data_t *pgdat =3D NODE_DATA(node); --=20 2.17.1