Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp3640599pxb; Mon, 30 Aug 2021 07:14:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXd07YXnN04ten0FAil69zCh9NUZZhzsoj93XJ1XKxUjasDtZMCpV0s3ZjIR/c9cdXdvO2 X-Received: by 2002:a05:6402:4404:: with SMTP id y4mr24414015eda.52.1630332899592; Mon, 30 Aug 2021 07:14:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630332899; cv=none; d=google.com; s=arc-20160816; b=R4elX4ZjWg31CLi3jHr50AUGOwiuvuisx90lLALWkpBwflswUnqD4BeE3V0M3qbOwn pyfXkY6TohYL8d5a157hLJ3eYXE44qO9d46myTVU+WShoE9LUYqxby5fxHMcX04Ncm7k aomva6mEJ1mjj9YFK87a8XweXkHz91twujj00vG9fEiy9O+XkssotsOMnSnKW7fy+RmX D3JKrgzxBoVHayzMqwIybH2bQ5TxUHNqv5DBzWe01RaaKLg4d6xluu9LhQN0uzoUV7ou LsZFCNUhMGAtKzQLnllJTDJLUI/qPiFbznORSpj8mV3ez+SPtSQPROZqwM5MbRT0Z4sh HEuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0PVGGmuB7hBiwrYJa7RxTC/SDZ+P38X4hej8Fkap3bE=; b=CD6RfJaxgIqC4iUn9G7M/NwwVtSxNzuXG9nG6nW83ZH1NIXZdhT/hnFCMUpY1TsfMC 7mh4sdniDgpTumIPZcUVMqgwIqhUrt8dBOkHVza28OQbwF4zsOJWITmbbYaRGbTfcbSt IjsvrsO5C75NtiUZ+r0BvqlMFHmaQ4l0pO4ZaKPzHISEjRjWulXBQq4zVwQLWymJA7nh XZEfFXWPUhlRylvmixejUUoIByR9KtHIoHhP7pc3mZlL77WFXBJJTBe/Awd5kLD1rCFe 3e+xZGFeDc7CD6DnO7OXP9gTTnIwtkdm3x0MdOpKm7S68Dg1XGgs1K+ixBbE0pEraEbW oOtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb8si15586346ejc.529.2021.08.30.07.14.26; Mon, 30 Aug 2021 07:14:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237102AbhH3OLe (ORCPT + 99 others); Mon, 30 Aug 2021 10:11:34 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:18990 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237007AbhH3OLU (ORCPT ); Mon, 30 Aug 2021 10:11:20 -0400 Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4GysYx2zLdzbkgN; Mon, 30 Aug 2021 22:06:29 +0800 (CST) Received: from huawei.com (10.175.124.27) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Mon, 30 Aug 2021 22:10:22 +0800 From: Miaohe Lin To: CC: , , , , , , Subject: [PATCH 4/6] mm/page_alloc.c: use helper function zone_spans_pfn() Date: Mon, 30 Aug 2021 22:10:49 +0800 Message-ID: <20210830141051.64090-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210830141051.64090-1-linmiaohe@huawei.com> References: <20210830141051.64090-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use helper function zone_spans_pfn() to check whether pfn is within a zone to simplify the code slightly. Signed-off-by: Miaohe Lin --- mm/page_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index b5edcfe112aa..7bb79e959ab4 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1576,7 +1576,7 @@ static void __meminit init_reserved_page(unsigned long pfn) for (zid = 0; zid < MAX_NR_ZONES; zid++) { struct zone *zone = &pgdat->node_zones[zid]; - if (pfn >= zone->zone_start_pfn && pfn < zone_end_pfn(zone)) + if (zone_spans_pfn(zone, pfn)) break; } __init_single_page(pfn_to_page(pfn), pfn, zid, nid); -- 2.23.0