Skip to content

Commit

Permalink
LoongArch: Fix the !THP build
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Huacai Chen <[email protected]>
  • Loading branch information
chenhuacai committed Jun 25, 2022
1 parent a111daf commit 501dcbe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/loongarch/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,

#define kern_addr_valid(addr) (1)

static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
}

#ifdef CONFIG_TRANSPARENT_HUGEPAGE

/* We don't have hardware dirty/accessed bits, generic_pmdp_establish is fine.*/
Expand Down Expand Up @@ -497,11 +502,6 @@ static inline pmd_t pmd_mkyoung(pmd_t pmd)
return pmd;
}

static inline unsigned long pmd_pfn(pmd_t pmd)
{
return (pmd_val(pmd) & _PFN_MASK) >> _PFN_SHIFT;
}

static inline struct page *pmd_page(pmd_t pmd)
{
if (pmd_trans_huge(pmd))
Expand Down

0 comments on commit 501dcbe

Please sign in to comment.