summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Töpel <bjorn@rivosinc.com>2025-04-19 13:13:59 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-02-11 13:37:27 +0100
commit21ac4fb3dc693e4a79993f0bb6c6fe6af2fe1992 (patch)
treeeeba73c5f71e731107612df15436023d3fb7d687
parent69b832cf2f342afcc6155548293f7af3bdf2c911 (diff)
downloadlinux-21ac4fb3dc693e4a79993f0bb6c6fe6af2fe1992.tar.gz
linux-21ac4fb3dc693e4a79993f0bb6c6fe6af2fe1992.tar.bz2
linux-21ac4fb3dc693e4a79993f0bb6c6fe6af2fe1992.zip
riscv: Replace function-like macro by static inline function
commit 121f34341d396b666d8a90b24768b40e08ca0d61 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: 08f051eda33b ("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>
-rw-r--r--arch/riscv/include/asm/cacheflush.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/riscv/include/asm/cacheflush.h b/arch/riscv/include/asm/cacheflush.h
index f6fbe7042f1c..fc65afc132ef 100644
--- a/arch/riscv/include/asm/cacheflush.h
+++ b/arch/riscv/include/asm/cacheflush.h
@@ -22,11 +22,6 @@ static inline void flush_dcache_page(struct page *page)
}
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
-/*
- * RISC-V doesn't have an instruction to flush parts of the instruction cache,
- * so instead we just flush the whole thing.
- */
-#define flush_icache_range(start, end) flush_icache_all()
#define flush_icache_user_page(vma, pg, addr, len) \
flush_icache_mm(vma->vm_mm, 0)
@@ -42,6 +37,16 @@ void flush_icache_mm(struct mm_struct *mm, bool local);
#endif /* CONFIG_SMP */
+/*
+ * RISC-V doesn't have an instruction to flush parts of the instruction cache,
+ * so instead we just flush the whole thing.
+ */
+#define flush_icache_range flush_icache_range
+static inline void flush_icache_range(unsigned long start, unsigned long end)
+{
+ flush_icache_all();
+}
+
extern unsigned int riscv_cbom_block_size;
void riscv_init_cbom_blocksize(void);