The new MMF_KERNEL flag identifies kernel-owned mm's. Checking the
flag with mm_is_kernel() is preferred over comparing directly
against &init_mm.

No functional change, as only init_mm has MMF_KERNEL set for now.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Kevin Brodsky <[email protected]>
---
 arch/loongarch/include/asm/mmu_context.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/include/asm/mmu_context.h 
b/arch/loongarch/include/asm/mmu_context.h
index 304363bd3935..6d51f11427b4 100644
--- a/arch/loongarch/include/asm/mmu_context.h
+++ b/arch/loongarch/include/asm/mmu_context.h
@@ -95,7 +95,7 @@ static inline void switch_mm_irqs_off(struct mm_struct *prev, 
struct mm_struct *
        if (!asid_valid(next, cpu))
                get_new_mmu_context(next, cpu, &need_flush);
 
-       if (next != &init_mm)
+       if (!mm_is_kernel(next))
                atomic_update_pgd_asid(cpu_asid(cpu, next), (unsigned 
long)next->pgd);
        else
                atomic_update_pgd_asid(cpu_asid(cpu, next), (unsigned 
long)invalid_pg_dir);

-- 
2.51.2


Reply via email to