From 0b317c389c6771cbe1c5a12fe9322285a808a9bd Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Sat, 2 Feb 2019 01:43:25 +0000 Subject: MIPS: mm: Add set_cpu_context() for ASID assignments When we gain MMID support we'll be storing MMIDs as atomic64_t values and accessing them via atomic64_* functions. This necessitates that we don't use cpu_context() as the left hand side of an assignment, ie. as a modifiable lvalue. In preparation for this introduce a new set_cpu_context() function & replace all assignments with cpu_context() on their left hand side with an equivalent call to set_cpu_context(). To enforce that cpu_context() should not be used for assignments, we rewrite it as a static inline function. Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org --- arch/mips/mm/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/mips/mm') diff --git a/arch/mips/mm/context.c b/arch/mips/mm/context.c index 4dd976acf41d..dcaceee179f7 100644 --- a/arch/mips/mm/context.c +++ b/arch/mips/mm/context.c @@ -15,7 +15,8 @@ void get_new_mmu_context(struct mm_struct *mm) local_flush_tlb_all(); /* start new asid cycle */ } - cpu_context(cpu, mm) = asid_cache(cpu) = asid; + set_cpu_context(cpu, mm, asid); + asid_cache(cpu) = asid; } void check_mmu_context(struct mm_struct *mm) -- cgit v1.2.3-70-g09d2