From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2260ECAAD3 for ; Thu, 15 Sep 2022 08:06:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 784888D0003; Thu, 15 Sep 2022 04:06:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7334D6B007B; Thu, 15 Sep 2022 04:06:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 621D88D0003; Thu, 15 Sep 2022 04:06:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 52AC76B0078 for ; Thu, 15 Sep 2022 04:06:25 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2C59480C1B for ; Thu, 15 Sep 2022 08:06:25 +0000 (UTC) X-FDA: 79913587530.23.8E18A04 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf28.hostedemail.com (Postfix) with ESMTP id CD9D9C00CE for ; Thu, 15 Sep 2022 08:06:22 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MSqTN2j8pznVJP; Thu, 15 Sep 2022 16:03:36 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 15 Sep 2022 16:06:18 +0800 Subject: Re: [PATCH 09/16] mm/page_alloc: use local variable zone_idx directly To: Oscar Salvador CC: , , , References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-10-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: <73b9a03a-232e-b327-641f-49bcd2e1bf9b@huawei.com> Date: Thu, 15 Sep 2022 16:06:18 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663229183; a=rsa-sha256; cv=none; b=y5HouP8RTf4qR/lrDdahNFCcAUl3i7chVPa9ZrqIPzFOqV5vfUesh1OkPRCAZdm0GTmhsb eyGJkk8IYuepS+vm5Psq2m7LSWCEGrdNWqp4sIgCI3lyVjH4Ag2WbAaM1rVFrPNwCJIgKp 89F4JsUFME6BnymwD9muKmfdB7fY8o0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663229183; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Rye+Jo4v7RHSSHrsA++ecdUw4sngyjipI8KMp+5E0bk=; b=3NcnAVCTaf4c7DpZ+ph7Kandvc8sW0VV762TRPvFY6vMSqdFB6Cpfm0OF56urigfy2LWXb XKomaHxmGfKxEHWT7dSrai4exYoQ4aOUj7aihXYGGkwPb5jCWs5046yJ7OHbnfwRiKBrDT ls6v7tjUJ/2vRfn9tR7YrX3lIebo9YA= X-Stat-Signature: 73d8ktwsz9q1oaxttezeeon9n9ywi7gj X-Rspamd-Queue-Id: CD9D9C00CE X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=none; spf=pass (imf28.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam12 X-HE-Tag: 1663229182-50642 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: On 2022/9/15 15:36, Oscar Salvador wrote: > On Fri, Sep 09, 2022 at 05:24:44PM +0800, Miaohe Lin wrote: >> Use local variable zone_idx directly since it holds the exact value of >> zone_idx(). No functional change intended. >> >> Signed-off-by: Miaohe Lin > > By the way, zone_idx being "int" should be enough? Yes, it should be. But zone_idx is used as "unsigned long" around this function, e.g. __init_zone_device_page expects zone_idx as "unsigned long", so it should be better to keep it as is ? > > Reviewed-by: Oscar Salvador Many thanks for your review and comment in this series. Thanks, 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 94baf33da865..3417232afa45 100644 >> --- a/mm/page_alloc.c >> +++ b/mm/page_alloc.c >> @@ -6878,7 +6878,7 @@ void __ref memmap_init_zone_device(struct zone *zone, >> unsigned long start = jiffies; >> int nid = pgdat->node_id; >> >> - if (WARN_ON_ONCE(!pgmap || zone_idx(zone) != ZONE_DEVICE)) >> + if (WARN_ON_ONCE(!pgmap || zone_idx != ZONE_DEVICE)) >> return; >> >> /* >> -- >> 2.23.0 >> >