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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49294C433F5 for ; Mon, 25 Apr 2022 13:49:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233215AbiDYNwC (ORCPT ); Mon, 25 Apr 2022 09:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232553AbiDYNv6 (ORCPT ); Mon, 25 Apr 2022 09:51:58 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551EC4A917 for ; Mon, 25 Apr 2022 06:48:54 -0700 (PDT) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Kn5tn1Cfzz1JBhk; Mon, 25 Apr 2022 21:48:01 +0800 (CST) Received: from [10.67.110.243] (10.67.110.243) by dggpemm500022.china.huawei.com (7.185.36.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 25 Apr 2022 21:48:52 +0800 Message-ID: Date: Mon, 25 Apr 2022 21:48:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH] mm: use pgprot_val to get value of pgprot Content-Language: en-US To: Kefeng Wang , Anshuman Khandual , CC: , , , , References: <20220425081736.249130-1-liusongtang@huawei.com> <22536b1c-f38d-45b1-8187-636c158b8e4b@huawei.com> From: liusongtang In-Reply-To: <22536b1c-f38d-45b1-8187-636c158b8e4b@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.110.243] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500022.china.huawei.com (7.185.36.162) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, Shall I add "Suggested-by: Kefeng Wang " to these patches? On 2022/4/25 18:40, Kefeng Wang wrote: > > On 2022/4/25 18:29, Anshuman Khandual wrote: >> Should have added 'memory_hotplug' in the subject line. Otherwise >> this does not specify where the change is (neither does the commit >> message below). >> >> mm/memory_hotplug: use pgprot_val to get value of pgprot > > > $ git grep "pgprot\.pgprot" > arch/ia64/mm/init.c:    if (WARN_ON_ONCE(params->pgprot.pgprot != > PAGE_KERNEL.pgprot)) > arch/s390/mm/init.c:    if (WARN_ON_ONCE(params->pgprot.pgprot != > PAGE_KERNEL.pgprot)) > arch/sh/mm/init.c:      if (WARN_ON_ONCE(params->pgprot.pgprot != > PAGE_KERNEL.pgprot)) > mm/memory_hotplug.c:    if (WARN_ON_ONCE(!params->pgprot.pgprot)) > > You can change other's codes too. > >> >> On 4/25/22 13:47, liusongtang wrote: >>> pgprot.pgprot is a non-portable code, it should be replaced by >>> portable macro pgprot_val. >>> >>> Signed-off-by: liusongtang >>> --- >>>   mm/memory_hotplug.c | 2 +- >>>   1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >>> index 416b38c..bf7d181 100644 >>> --- a/mm/memory_hotplug.c >>> +++ b/mm/memory_hotplug.c >>> @@ -303,7 +303,7 @@ int __ref __add_pages(int nid, unsigned long >>> pfn, unsigned long nr_pages, >>>       int err; >>>       struct vmem_altmap *altmap = params->altmap; >>>   -    if (WARN_ON_ONCE(!params->pgprot.pgprot)) >>> +    if (WARN_ON_ONCE(!pgprot_val(params->pgprot))) >>>           return -EINVAL; >>>         VM_BUG_ON(!mhp_range_allowed(PFN_PHYS(pfn), nr_pages * >>> PAGE_SIZE, false)); >> Otherwise LGTM. >> >> Reviewed-by: Anshuman Khandual >> >> . > .