Skip to content

Commit 9a27324

Browse files
committed
MIPS: mm: Remove redundant drop_mmu_context() cpu argument
The drop_mmu_context() function accepts a cpu argument, but it implicitly expects that this is always equal to smp_processor_id() by allocating & configuring an ASID on the local CPU when the mm is active on the CPU indicated by the cpu argument. All callers do provide the value of smp_processor_id() to the cpu argument. Remove the redundant argument and have drop_mmu_context() call smp_processor_id() itself, making it clearer that the cpu variable always represents the local CPU. Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org
1 parent c653bd0 commit 9a27324

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

arch/mips/include/asm/mmu_context.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,15 @@ static inline void destroy_context(struct mm_struct *mm)
174174
* we will get a new one for it.
175175
*/
176176
static inline void
177-
drop_mmu_context(struct mm_struct *mm, unsigned cpu)
177+
drop_mmu_context(struct mm_struct *mm)
178178
{
179179
unsigned long flags;
180+
unsigned int cpu;
180181

181182
local_irq_save(flags);
182183
htw_stop();
183184

185+
cpu = smp_processor_id();
184186
if (cpumask_test_cpu(cpu, mm_cpumask(mm))) {
185187
get_new_mmu_context(mm, cpu);
186188
write_c0_entryhi(cpu_asid(cpu, mm));

arch/mips/mm/c-r4k.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ static inline void local_r4k_flush_cache_page(void *args)
700700
int cpu = smp_processor_id();
701701

702702
if (cpu_context(cpu, mm) != 0)
703-
drop_mmu_context(mm, cpu);
703+
drop_mmu_context(mm);
704704
} else
705705
vaddr ? r4k_blast_icache_page(addr) :
706706
r4k_blast_icache_user_page(addr);

arch/mips/mm/tlb-r3k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void local_flush_tlb_mm(struct mm_struct *mm)
7575
#ifdef DEBUG_TLB
7676
printk("[tlbmm<%lu>]", (unsigned long)cpu_context(cpu, mm));
7777
#endif
78-
drop_mmu_context(mm, cpu);
78+
drop_mmu_context(mm);
7979
}
8080
}
8181

@@ -117,7 +117,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
117117
}
118118
write_c0_entryhi(oldpid);
119119
} else {
120-
drop_mmu_context(mm, cpu);
120+
drop_mmu_context(mm);
121121
}
122122
local_irq_restore(flags);
123123
}

arch/mips/mm/tlb-r4k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void local_flush_tlb_mm(struct mm_struct *mm)
115115
cpu = smp_processor_id();
116116

117117
if (cpu_context(cpu, mm) != 0) {
118-
drop_mmu_context(mm, cpu);
118+
drop_mmu_context(mm);
119119
}
120120

121121
preempt_enable();
@@ -163,7 +163,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
163163
write_c0_entryhi(oldpid);
164164
htw_start();
165165
} else {
166-
drop_mmu_context(mm, cpu);
166+
drop_mmu_context(mm);
167167
}
168168
flush_micro_tlb();
169169
local_irq_restore(flags);

arch/mips/mm/tlb-r8k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void local_flush_tlb_mm(struct mm_struct *mm)
5555
int cpu = smp_processor_id();
5656

5757
if (cpu_context(cpu, mm) != 0)
58-
drop_mmu_context(mm, cpu);
58+
drop_mmu_context(mm);
5959
}
6060

6161
void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
@@ -75,7 +75,7 @@ void local_flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
7575
local_irq_save(flags);
7676

7777
if (size > TFP_TLB_SIZE / 2) {
78-
drop_mmu_context(mm, cpu);
78+
drop_mmu_context(mm);
7979
goto out_restore;
8080
}
8181

0 commit comments

Comments
 (0)