Commit f5bf645d authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Paul Walmsley

riscv: cleanup riscv_cpuid_to_hartid_mask

Move the initial clearing of the mask from the callers to
riscv_cpuid_to_hartid_mask, and remove the unused !CONFIG_SMP stub.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
Signed-off-by: default avatarPaul Walmsley <paul.walmsley@sifive.com>
parent e11ea2a0
...@@ -61,11 +61,5 @@ static inline unsigned long cpuid_to_hartid_map(int cpu) ...@@ -61,11 +61,5 @@ static inline unsigned long cpuid_to_hartid_map(int cpu)
return boot_cpu_hartid; return boot_cpu_hartid;
} }
static inline void riscv_cpuid_to_hartid_mask(const struct cpumask *in,
struct cpumask *out)
{
cpumask_set_cpu(cpuid_to_hartid_map(0), out);
}
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
#endif /* _ASM_RISCV_SMP_H */ #endif /* _ASM_RISCV_SMP_H */
...@@ -47,7 +47,6 @@ static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start, ...@@ -47,7 +47,6 @@ static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start,
{ {
struct cpumask hmask; struct cpumask hmask;
cpumask_clear(&hmask);
riscv_cpuid_to_hartid_mask(cmask, &hmask); riscv_cpuid_to_hartid_mask(cmask, &hmask);
sbi_remote_sfence_vma(hmask.bits, start, size); sbi_remote_sfence_vma(hmask.bits, start, size);
} }
......
...@@ -56,6 +56,7 @@ void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out) ...@@ -56,6 +56,7 @@ void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out)
{ {
int cpu; int cpu;
cpumask_clear(out);
for_each_cpu(cpu, in) for_each_cpu(cpu, in)
cpumask_set_cpu(cpuid_to_hartid_map(cpu), out); cpumask_set_cpu(cpuid_to_hartid_map(cpu), out);
} }
......
...@@ -47,7 +47,6 @@ void flush_icache_mm(struct mm_struct *mm, bool local) ...@@ -47,7 +47,6 @@ void flush_icache_mm(struct mm_struct *mm, bool local)
cpumask_andnot(&others, mm_cpumask(mm), cpumask_of(cpu)); cpumask_andnot(&others, mm_cpumask(mm), cpumask_of(cpu));
local |= cpumask_empty(&others); local |= cpumask_empty(&others);
if (mm != current->active_mm || !local) { if (mm != current->active_mm || !local) {
cpumask_clear(&hmask);
riscv_cpuid_to_hartid_mask(&others, &hmask); riscv_cpuid_to_hartid_mask(&others, &hmask);
sbi_remote_fence_i(hmask.bits); sbi_remote_fence_i(hmask.bits);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment