From patchwork Wed Jan 27 09:32:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12049491 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98C64C433E0 for ; Wed, 27 Jan 2021 09:32:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B10E820771 for ; Wed, 27 Jan 2021 09:32:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B10E820771 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 05AFB6B0006; Wed, 27 Jan 2021 04:32:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 00A316B0008; Wed, 27 Jan 2021 04:32:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E642B6B000A; Wed, 27 Jan 2021 04:32:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0087.hostedemail.com [216.40.44.87]) by kanga.kvack.org (Postfix) with ESMTP id CD9BB6B0006 for ; Wed, 27 Jan 2021 04:32:34 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 9C66BFB56 for ; Wed, 27 Jan 2021 09:32:34 +0000 (UTC) X-FDA: 77751039828.26.part32_180c80b27595 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 755F6180F3242 for ; Wed, 27 Jan 2021 09:32:34 +0000 (UTC) X-HE-Tag: part32_180c80b27595 X-Filterd-Recvd-Size: 2881 Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Wed, 27 Jan 2021 09:32:33 +0000 (UTC) Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DQddF1rPzzl9cY; Wed, 27 Jan 2021 17:30:57 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Wed, 27 Jan 2021 17:32:19 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/memory_hotplug: use helper function zone_end_pfn() to get end_pfn Date: Wed, 27 Jan 2021 04:32:11 -0500 Message-ID: <20210127093211.37714-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit 108bcc96ef70 ("mm: add & use zone_end_pfn() and zone_spans_pfn()") introduced the helper zone_end_pfn() to calculate the zone end pfn. But update_pgdat_span() forgot to use it. Use this helper and re-name local variable zone_end_pfn to end_pfn to fix below compilation error: mm/memory_hotplug.c: In function ‘update_pgdat_span’: mm/memory_hotplug.c:448:32: error: called object ‘zone_end_pfn’ is not a function or function pointer unsigned long zone_end_pfn = zone_end_pfn(zone); ^~~~~~~~~~~~ mm/memory_hotplug.c:448:17: note: declared here unsigned long zone_end_pfn = zone_end_pfn(zone); ^~~~~~~~~~~~ Signed-off-by: Miaohe Lin Reviewed-by: David Hildenbrand --- mm/memory_hotplug.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 710e469fb3a1..0483db52b85f 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -493,20 +493,19 @@ static void update_pgdat_span(struct pglist_data *pgdat) for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) { - unsigned long zone_end_pfn = zone->zone_start_pfn + - zone->spanned_pages; + unsigned long end_pfn = zone_end_pfn(zone); /* No need to lock the zones, they can't change. */ if (!zone->spanned_pages) continue; if (!node_end_pfn) { node_start_pfn = zone->zone_start_pfn; - node_end_pfn = zone_end_pfn; + node_end_pfn = end_pfn; continue; } - if (zone_end_pfn > node_end_pfn) - node_end_pfn = zone_end_pfn; + if (end_pfn > node_end_pfn) + node_end_pfn = end_pfn; if (zone->zone_start_pfn < node_start_pfn) node_start_pfn = zone->zone_start_pfn; }