aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@sifive.com>2018-08-28 12:37:16 -0400
committerPalmer Dabbelt <palmer@sifive.com>2018-08-28 15:58:36 -0400
commit47d80a68f10d3290204a12f7836a9a8190dfc327 (patch)
treeca38c2a9ebcfe536e51fcea23628834fb86fac8f
parent0ce5671c4450527f90d2bfb31302f78580587983 (diff)
RISC-V: Use a less ugly workaround for unused variable warnings
Thanks to Christoph Hellwig for pointing out a cleaner way to do this, as my approach was quite ugly. CC: Christoph Hellwig <hch@lst.de> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
-rw-r--r--arch/riscv/kernel/sys_riscv.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/arch/riscv/kernel/sys_riscv.c b/arch/riscv/kernel/sys_riscv.c
index 568026ccf6e8..fb03a4482ad6 100644
--- a/arch/riscv/kernel/sys_riscv.c
+++ b/arch/riscv/kernel/sys_riscv.c
@@ -65,24 +65,11 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
65SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end, 65SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,
66 uintptr_t, flags) 66 uintptr_t, flags)
67{ 67{
68#ifdef CONFIG_SMP
69 struct mm_struct *mm = current->mm;
70 bool local = (flags & SYS_RISCV_FLUSH_ICACHE_LOCAL) != 0;
71#endif
72
73 /* Check the reserved flags. */ 68 /* Check the reserved flags. */
74 if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL)) 69 if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL))
75 return -EINVAL; 70 return -EINVAL;
76 71
77 /* 72 flush_icache_mm(current->mm, flags & SYS_RISCV_FLUSH_ICACHE_LOCAL);
78 * Without CONFIG_SMP flush_icache_mm is a just a flush_icache_all(),
79 * which generates unused variable warnings all over this function.
80 */
81#ifdef CONFIG_SMP
82 flush_icache_mm(mm, local);
83#else
84 flush_icache_all();
85#endif
86 73
87 return 0; 74 return 0;
88} 75}