x86/mm: always pass NULL as the first argument of switch_mm_irqs_off()
authorYosry Ahmed <yosryahmed@google.com>
Thu, 22 Feb 2024 19:09:11 +0000 (19:09 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 5 Mar 2024 01:01:14 +0000 (17:01 -0800)
The first argument of switch_mm_irqs_off() is unused by the x86
implementation.  Make sure that x86 code never passes a non-NULL value to
make this clear.  Update the only non violating caller, switch_mm().

Link: https://lkml.kernel.org/r/20240222190911.1903054-2-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Suggested-by: Dave Hansen <dave.hansen@intel.com>
Acked-by: Dave Hansen <dave.hansen@intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/tlb.c

index b67545baf6973bc2ab1ec0199d33115b84a93591..51f9f56941058de0727b7d97dca1046b1f1e76e7 100644 (file)
@@ -327,7 +327,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
        unsigned long flags;
 
        local_irq_save(flags);
-       switch_mm_irqs_off(prev, next, tsk);
+       switch_mm_irqs_off(NULL, next, tsk);
        local_irq_restore(flags);
 }