Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4121744pxf; Tue, 6 Apr 2021 08:23:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRW+VAaCuSlxTSZcKIBsHlFkjg7qMbngo5ts69PdLP2EOoeAxzhLXnHoMuOXP/OCnqtgaX X-Received: by 2002:a6b:ec08:: with SMTP id c8mr23164343ioh.55.1617722608926; Tue, 06 Apr 2021 08:23:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617722608; cv=none; d=google.com; s=arc-20160816; b=mNPWPOobF2Yudf/08nsEZaEsw7Q6SSFRNcrl5jdMcR1qpctPRp7luc2kiGMpj+k5lP uz1HPyfv0NPTvQBup+PjSlfTNhGe8/qN6KBeRvWOm5AatDg4tuKYsUMNlRtyLywsq4MR hIDpvp3tUjlDaMKaz5nlH2K5seXI7ODnCrFtQLG55MtaCaeQlCXqcr0gC7AGIzwiutPu zzJ9s0OnNAbxxZWZd6xmoRTmCSRMkLq8jY8Z4/ncN9R3wVuGAd8vtehhUYODXPqgu+qy xJPCHTYdzbu9TLXLM4H/BevTWeIucPakvw8sa2fI6sV2nOEhrA0+R6nRKP4z2JKJP55p aIjw== 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=JL/dN3klhkYT0t5TWZI4WqI/qvGD96IjGAQ0ICSRggo=; b=JVNa6+tJiLF8tehXOv4Br4/Lj8dhTVt50Odk+fiL4sVD4R8To+MBPQtoOYvQzdz7vi RP3kEz7YbI/eJZqj+GqxX2FrSkrtvpySjeoss3e2ZJVzI5RwU7lXvdM9IBWEjLQNXvWY IZGQ+Rg1evJB2/qEMzNTWWoznqgEe4qxsAd5lCdFt0lfRHKwLQC85v9jWZorOUqNCoR7 ZADOCWBMBhuGgKLNlVQbsO4R3askWxE7cA4Zps67hDdgI0XCNDi2lCFg/dJhR0Fp72Ob PCzphdn9FaTmXKffIzo84K8m1Y/Ay0kG6X+Uz2NfG+ZPbiG3pj6HKNLWplvszmFMLK/E MWmA== 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 b1si6796624ilf.45.2021.04.06.08.23.10; Tue, 06 Apr 2021 08:23:28 -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 S243616AbhDFEtr (ORCPT + 99 others); Tue, 6 Apr 2021 00:49:47 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15130 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234030AbhDFEtq (ORCPT ); Tue, 6 Apr 2021 00:49:46 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FDw3d3B6FzmctL; Tue, 6 Apr 2021 12:46:53 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Tue, 6 Apr 2021 12:49:29 +0800 From: Shixin Liu To: Andrew Morton , Anshuman Khandual CC: , , Shixin Liu Subject: [PATCH -next v2 2/2] mm/debug_vm_pgtable: Remove redundant pfn_{pmd/pte}() and fix one comment mistake Date: Tue, 6 Apr 2021 12:49:00 +0800 Message-ID: <20210406044900.2178705-2-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210406044900.2178705-1-liushixin2@huawei.com> References: <20210406044900.2178705-1-liushixin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1->v2: Remove redundant pfn_pte() and fold two patch to one. Remove redundant pfn_{pmd/pte}() and fix one comment mistake. Signed-off-by: Shixin Liu --- mm/debug_vm_pgtable.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c index d3cf178621d9..e2f35db8ba69 100644 --- a/mm/debug_vm_pgtable.c +++ b/mm/debug_vm_pgtable.c @@ -91,7 +91,7 @@ static void __init pte_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pte_t pte = pfn_pte(pfn, prot); + pte_t pte; /* * Architectures optimize set_pte_at by avoiding TLB flush. @@ -185,7 +185,7 @@ static void __init pmd_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot, pgtable_t pgtable) { - pmd_t pmd = pfn_pmd(pfn, prot); + pmd_t pmd; if (!has_transparent_hugepage()) return; @@ -300,7 +300,7 @@ static void __init pud_advanced_tests(struct mm_struct *mm, unsigned long pfn, unsigned long vaddr, pgprot_t prot) { - pud_t pud = pfn_pud(pfn, prot); + pud_t pud; if (!has_transparent_hugepage()) return; @@ -309,6 +309,7 @@ static void __init pud_advanced_tests(struct mm_struct *mm, /* Align the address wrt HPAGE_PUD_SIZE */ vaddr = (vaddr & HPAGE_PUD_MASK) + HPAGE_PUD_SIZE; + pud = pfn_pud(pfn, prot); set_pud_at(mm, vaddr, pudp, pud); pudp_set_wrprotect(mm, vaddr, pudp); pud = READ_ONCE(*pudp); @@ -742,12 +743,12 @@ static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) WARN_ON(!pmd_swp_soft_dirty(pmd_swp_mksoft_dirty(pmd))); WARN_ON(pmd_swp_soft_dirty(pmd_swp_clear_soft_dirty(pmd))); } -#else /* !CONFIG_ARCH_HAS_PTE_DEVMAP */ +#else /* !CONFIG_TRANSPARENT_HUGEPAGE */ static void __init pmd_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { } static void __init pmd_swap_soft_dirty_tests(unsigned long pfn, pgprot_t prot) { } -#endif /* CONFIG_ARCH_HAS_PTE_DEVMAP */ +#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ static void __init pte_swap_tests(unsigned long pfn, pgprot_t prot) { -- 2.25.1