aboutsummaryrefslogtreecommitdiffstats
path: root/arch/riscv/include/asm/pgtable.h
diff options
context:
space:
mode:
authorNanyong Sun <sunnanyong@huawei.com>2021-06-17 17:58:31 +0800
committerPalmer Dabbelt <palmerdabbelt@google.com>2021-07-05 18:42:31 -0700
commit9eb4fcff220790f4afadf59160f2c696e99f0a84 (patch)
treeafab52c5f4e81ed972198468b4c1e8d9c182c14d /arch/riscv/include/asm/pgtable.h
parentriscv: Introduce structure that group all variables regarding kernel mapping (diff)
downloadlinux-dev-9eb4fcff220790f4afadf59160f2c696e99f0a84.tar.xz
linux-dev-9eb4fcff220790f4afadf59160f2c696e99f0a84.zip
riscv: mm: fix build errors caused by mk_pmd()
With "riscv: mm: add THP support on 64-bit", mk_pmd() function introduce build errors, 1.build with CONFIG_ARCH_RV32I=y: arch/riscv/include/asm/pgtable.h: In function 'mk_pmd': arch/riscv/include/asm/pgtable.h:513:9: error: implicit declaration of function 'pfn_pmd'; did you mean 'pfn_pgd'? [-Werror=implicit-function-declaration] 2.build with CONFIG_SPARSEMEM=y && CONFIG_SPARSEMEM_VMEMMAP=n arch/riscv/include/asm/pgtable.h: In function 'mk_pmd': include/asm-generic/memory_model.h:64:14: error: implicit declaration of function 'page_to_section'; did you mean 'present_section'? [-Werror=implicit-function-declaration] Move the definition of mk_pmd to pgtable-64.h to fix the first error. Use macro definition instead of inline function for mk_pmd to fix the second problem. It is similar to the mk_pte macro. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nanyong Sun <sunnanyong@huawei.com> Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/include/asm/pgtable.h')
-rw-r--r--arch/riscv/include/asm/pgtable.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 2056faf06f13..559ca4186b5c 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -516,11 +516,6 @@ static inline unsigned long pmd_pfn(pmd_t pmd)
return ((__pmd_to_phys(pmd) & PMD_MASK) >> PAGE_SHIFT);
}
-static inline pmd_t mk_pmd(struct page *page, pgprot_t prot)
-{
- return pfn_pmd(page_to_pfn(page), prot);
-}
-
static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
{
return pte_pmd(pte_modify(pmd_pte(pmd), newprot));