LoongArch: use asm-generic/mmu_context.h for no-op implementations
PATCH 1/1 LoongArch: use asm-generic/mmu_context.h for no-op implementations
enter_lazy_tlb(), destroy_context(), activate_mm() and deactivate_mm() are all no-ops that are already provided by default by asm-generic/mmu_context.h, so drop the local duplicates and include it instead, guarding init_new_context() which keeps its own real implementation.
Signed-off-by Tobias Klauser <[email protected]>
--- arch/loongarch/include/asm/mmu_context.h | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
arch/loongarch/include/asm/mmu_context.h +3 -15
@@ -43,10 +43,6 @@ static inline int asid_valid(struct mm_struct *mm, unsigned int cpu)return 1 ; } -static inline void enter_lazy_tlb (struct mm_struct *mm,struct task_struct *tsk) -{ -} -/* Normal, classic get_new_mmu_context */ static inline void get_new_mmu_context (struct mm_struct *mm,unsigned long cpu,bool *need_flush)
@@ -63,6 +59,7 @@ get_new_mmu_context(struct mm_struct *mm, unsigned long cpu, bool *need_flush)* Initialize the context related info for a new mm_struct * instance. */ +#define init_new_context init_new_contextstatic inline int init_new_context (struct task_struct *tsk,struct mm_struct *mm) {
@@ -122,17 +119,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,local_irq_restore (flags); } -/* -* Destroy context related info for an mm_struct that is about -* to be put to rest. -*/ -static inline void destroy_context (struct mm_struct *mm) -{ -} - -#define activate_mm (prev, next) switch_mm(prev, next, current) -#define deactivate_mm (task, mm) do { } while (0) -/* * If mm is currently active, we can't really drop it. * Instead, we will get a new one for it.
@@ -168,4 +154,6 @@ drop_mmu_context(struct mm_struct *mm, unsigned int cpu) local_irq_restore(flags); } +#include <asm-generic/mmu_context.h> +#endif /* _ASM_MMU_CONTEXT_H */
Signature · 1 line
2.55.0