From c9b2a3dc240c444b4f7b556e2cce756828720856 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Sat, 2 Feb 2019 01:43:19 +0000 Subject: MIPS: mm: Consolidate drop_mmu_context() has-ASID checks If an mm does not have an ASID on the local CPU then drop_mmu_context() is always redundant, since there's no context to "drop". Various callers of drop_mmu_context() check whether the mm has been allocated an ASID before making the call. Move that check into drop_mmu_context() and remove it from callers to simplify them. Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org --- arch/mips/include/asm/mmu_context.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/mips/include/asm/mmu_context.h') diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h index 5d0a73a5cf40..1b8392dcd354 100644 --- a/arch/mips/include/asm/mmu_context.h +++ b/arch/mips/include/asm/mmu_context.h @@ -186,7 +186,9 @@ drop_mmu_context(struct mm_struct *mm) local_irq_save(flags); cpu = smp_processor_id(); - if (cpumask_test_cpu(cpu, mm_cpumask(mm))) { + if (!cpu_context(cpu, mm)) { + /* no-op */ + } else if (cpumask_test_cpu(cpu, mm_cpumask(mm))) { htw_stop(); get_new_mmu_context(mm); write_c0_entryhi(cpu_asid(cpu, mm)); -- cgit v1.2.3