Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp472094rwn; Thu, 15 Sep 2022 01:20:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR7vBxhqmIHDGFZdcqmcdco3NGFREo75cEvmX87xVDRk3YqbMZtsQkcbvODTZNN6p+9IG7tk X-Received: by 2002:a05:6402:2b8d:b0:43a:5410:a9fc with SMTP id fj13-20020a0564022b8d00b0043a5410a9fcmr34228985edb.99.1663230027809; Thu, 15 Sep 2022 01:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663230027; cv=none; d=google.com; s=arc-20160816; b=viI487cILOBpf1/JYZvGi3XkKjhgc7PyYIvG+HECaRkFPht2n3CS0hPa6EwWvGeHtt MfYdogZFwz1MA/eBCzhhc1S8jlPPGCyKXKQC8DcXVvZdrMXMsd2h5v7xCzKXB417H5+W 4Tm2Y91/1havpMfcP2Cx/0KKZr+riNsQ65F1hlyhFIVG1F3is4RdRoUTHNTyd9dvySts Nhd4lCsXY0Y4JDGjjQ1Nopovle1uieX65rOXodOsrYkiu+W26cSB8R72E1jt1d1KXrOI TB0R1W162jftjCM0g4EbE7TJFIkbORSqlVeaiLTDnwY/VzKp2LiNjQLSqAerxGAKrnYd JEKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Rye+Jo4v7RHSSHrsA++ecdUw4sngyjipI8KMp+5E0bk=; b=va+BQrR1WdSh2dbj8EEzJhvIPTJf6+Tm/6Dx3FzPV1Qk/5KdQ1+STbUK+tgt6fU5Z/ n8TpzkPOVXTDiPRZhMPTXw8KLJDyzZBC+LIiEhkSZq0MjDzQP6RoGzynXAmOca9K3Oto +3+0K2SQcMSQKDqV6d3CLpQC3938zT8ugBsiu4FPURsHYIiU7kC/shye9rISEDl9iXqc 3BnFwRyivNnAPnFFWtBpEaRSiJnHejjE4jITKor87u2WTX8+h0IyJHMSeAsEJeuVx7B/ xPlcMCb9cSjYlB37iBrtTkG/JlgitwEFYCLAbiXzFLCSprVkwi9zxf8hFPsm3pXzIfkz zrmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e12-20020a056402190c00b004527d1dc10csi6593457edz.508.2022.09.15.01.19.53; Thu, 15 Sep 2022 01:20:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230173AbiIOIGZ (ORCPT + 99 others); Thu, 15 Sep 2022 04:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbiIOIGW (ORCPT ); Thu, 15 Sep 2022 04:06:22 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D77C94EFA for ; Thu, 15 Sep 2022 01:06:20 -0700 (PDT) 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 X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >