Skip to content

Commit 0b1ac97

Browse files
bjorn-rivosgregkh
authored andcommitted
riscv: Replace function-like macro by static inline function
commit 121f343 upstream. The flush_icache_range() function is implemented as a "function-like macro with unused parameters", which can result in "unused variables" warnings. Replace the macro with a static inline function, as advised by Documentation/process/coding-style.rst. Fixes: 08f051e ("RISC-V: Flush I$ when making a dirty page executable") Signed-off-by: Björn Töpel <bjorn@rivosinc.com> Link: https://lore.kernel.org/r/20250419111402.1660267-1-bjorn@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Ron Economos <re@w6rz.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d03ee41 commit 0b1ac97

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

arch/riscv/include/asm/cacheflush.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ static inline void flush_dcache_page(struct page *page)
3434
flush_dcache_folio(page_folio(page));
3535
}
3636

37-
/*
38-
* RISC-V doesn't have an instruction to flush parts of the instruction cache,
39-
* so instead we just flush the whole thing.
40-
*/
41-
#define flush_icache_range(start, end) flush_icache_all()
4237
#define flush_icache_user_page(vma, pg, addr, len) \
4338
flush_icache_mm(vma->vm_mm, 0)
4439

@@ -59,6 +54,16 @@ void flush_icache_mm(struct mm_struct *mm, bool local);
5954

6055
#endif /* CONFIG_SMP */
6156

57+
/*
58+
* RISC-V doesn't have an instruction to flush parts of the instruction cache,
59+
* so instead we just flush the whole thing.
60+
*/
61+
#define flush_icache_range flush_icache_range
62+
static inline void flush_icache_range(unsigned long start, unsigned long end)
63+
{
64+
flush_icache_all();
65+
}
66+
6267
extern unsigned int riscv_cbom_block_size;
6368
extern unsigned int riscv_cboz_block_size;
6469
void riscv_init_cbo_blocksizes(void);

0 commit comments

Comments
 (0)