History

LoongArch: Fix the !THP build

Fix the !THP build by making pmd_pfn() available in all configurations. Because pmd_pfn() is used in mm/page_vma_mapped.c whether or not THP is configured.

Huacai Chen committed 4 years ago

Commit 501dcbe1 parent a111daf1 file · +5 −5Browse files

Unified · Split

arch/loongarch/include/asm/pgtable.h+5−5
@@ -426,6 +426,11 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, · 425 unmodified lines
426426
427427 #define kern_addr_valid(addr) (1)
428428
429+static inline unsigned long pmd_pfn(pmd_t pmd)
430+{
431+ return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
432+}
433+
429434 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
430435
431436 /* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
@@ -497,11 +502,6 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd) · 65 unmodified lines
497502 return pmd;
498503 }
499504
500−static inline unsigned long pmd_pfn(pmd_t pmd)
501−{
502− return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
503−}
504−
505505 static inline struct page *pmd_page(pmd_t pmd)
506506 {
507507 if (pmd_trans_huge(pmd))