Skip to content

Commit 47d80a6

Browse files
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>
1 parent 0ce5671 commit 47d80a6

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

arch/riscv/kernel/sys_riscv.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,11 @@ SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
6565
SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,
6666
uintptr_t, flags)
6767
{
68-
#ifdef CONFIG_SMP
69-
struct mm_struct *mm = current->mm;
70-
bool local = (flags & SYS_RISCV_FLUSH_ICACHE_LOCAL) != 0;
71-
#endif
72-
7368
/* Check the reserved flags. */
7469
if (unlikely(flags & ~SYS_RISCV_FLUSH_ICACHE_ALL))
7570
return -EINVAL;
7671

77-
/*
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
72+
flush_icache_mm(current->mm, flags & SYS_RISCV_FLUSH_ICACHE_LOCAL);
8673

8774
return 0;
8875
}

0 commit comments

Comments
 (0)