--- a/arch/mips/mm/tlb-r4k.c +++ b/arch/mips/mm/tlb-r4k.c @@ -293,12 +293,6 @@ void local_flush_tlb_one(unsigned long page) void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { -#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT - pgd_t *pgdp; - p4d_t *p4dp; - pud_t *pudp; - pmd_t *pmdp; -#endif unsigned long flags; int idx, pid; @@ -323,12 +317,8 @@ void update_mmu_cache(struct vm_area_struct *vma, tlb_probe_hazard(); idx = read_c0_index(); #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT - pgdp = pgd_offset(vma->vm_mm, address); - p4dp = p4d_offset(pgdp, address); - pudp = pud_offset(p4dp, address); - pmdp = pmd_offset(pudp, address); /* this could be a huge page */ - if (ptep == (pte_t *)pmdp) { + if (pmd_huge(*(pmd_t *)ptep)) { unsigned long lo; write_c0_pagemask(PM_HUGE_MASK); lo = pte_to_entrylo(pte_val(*ptep));