From patchwork Tue Apr 26 07:13:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liusongtang X-Patchwork-Id: 12826563 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 ADAC9C433F5 for ; Tue, 26 Apr 2022 07:13:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 23D286B0073; Tue, 26 Apr 2022 03:13:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1ED196B0075; Tue, 26 Apr 2022 03:13:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DC936B0078; Tue, 26 Apr 2022 03:13:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 01BAF6B0073 for ; Tue, 26 Apr 2022 03:13:15 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id CA49A80787 for ; Tue, 26 Apr 2022 07:13:15 +0000 (UTC) X-FDA: 79398163950.21.6BC05D5 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf15.hostedemail.com (Postfix) with ESMTP id 610D9A0040 for ; Tue, 26 Apr 2022 07:13:10 +0000 (UTC) Received: from dggpemm500022.china.huawei.com (unknown [172.30.72.54]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4KnXzX45Q5zCsR4; Tue, 26 Apr 2022 15:08:40 +0800 (CST) Received: from linux-suspe12sp5.huawei.com (10.67.133.42) 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; Tue, 26 Apr 2022 15:13:11 +0800 From: liusongtang To: , CC: , , , , , , Subject: [PATCH v2] mm/memory_hotplug: use pgprot_val to get value of pgprot Date: Tue, 26 Apr 2022 15:13:02 +0800 Message-ID: <20220426071302.220646-1-liusongtang@huawei.com> X-Mailer: git-send-email 2.12.3 MIME-Version: 1.0 X-Originating-IP: [10.67.133.42] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500022.china.huawei.com (7.185.36.162) X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 610D9A0040 X-Stat-Signature: 7jebuct8e4tcjkndwmgprn1a787nz1df X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf15.hostedemail.com: domain of liusongtang@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=liusongtang@huawei.com X-Rspamd-Server: rspam09 X-HE-Tag: 1650957190-224158 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: pgprot.pgprot is a non-portable code, it should be replaced by portable macro pgprot_val. Signed-off-by: liusongtang Reviewed-by: Anshuman Khandual --- v2: add 'memory_hotplug' in the subject line v1: https://lore.kernel.org/all/a5b58a66-bdc3-94df-6af5-c647da888c17@huawei.com/ --- 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));