Skip to content

Commit 674bc01

Browse files
SiFiveHollandpalmer-dabbelt
authored andcommitted
riscv: mm: Fix prototype to avoid discarding const
__flush_tlb_range() does not modify the provided cpumask, so its cmask parameter can be pointer-to-const. This avoids the unsafe cast of cpu_online_mask. Fixes: 54d7431 ("riscv: Add support for BATCHED_UNMAP_TLB_FLUSH") Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Alexandre Ghiti <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 4cece76 commit 674bc01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/riscv/mm/tlbflush.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static void __ipi_flush_tlb_range_asid(void *info)
9999
local_flush_tlb_range_asid(d->start, d->size, d->stride, d->asid);
100100
}
101101

102-
static void __flush_tlb_range(struct cpumask *cmask, unsigned long asid,
102+
static void __flush_tlb_range(const struct cpumask *cmask, unsigned long asid,
103103
unsigned long start, unsigned long size,
104104
unsigned long stride)
105105
{
@@ -200,7 +200,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
200200

201201
void flush_tlb_kernel_range(unsigned long start, unsigned long end)
202202
{
203-
__flush_tlb_range((struct cpumask *)cpu_online_mask, FLUSH_TLB_NO_ASID,
203+
__flush_tlb_range(cpu_online_mask, FLUSH_TLB_NO_ASID,
204204
start, end - start, PAGE_SIZE);
205205
}
206206

0 commit comments

Comments
 (0)