RISC-V: Logical vs Bitwise typo
Subsystems (2)
PATCH 1/1 RISC-V: Logical vs Bitwise typo
In the current code, there is a ! logical NOT where a bitwise ~ NOT was intended. It means that we never return -EINVAL.
Signed-off-by Dan Carpenter <[email protected]>
arch/riscv/kernel/sys_riscv.c +1 -1
@@ -70,7 +70,7 @@ SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,bool local = (flags &SYS_RISCV_FLUSH_ICACHE_LOCAL ) !=0 ;/* Check the reserved flags. */ -if (unlikely (flags & !SYS_RISCV_FLUSH_ICACHE_ALL )) +if (unlikely (flags & ~SYS_RISCV_FLUSH_ICACHE_ALL ))return -EINVAL ;flush_icache_mm (mm, local);
Quoted 10 lines · On Sat, 09 Dec 2017 03:49:14 PST (-0800), [email protected] wrote:
In the current code, there is a ! logical NOT where a bitwise ~ NOT was intended. It means that we never return
-EINVAL.Signed-off-by Dan Carpenter <[email protected]>arch/riscv/kernel/sys_riscv.c +0
-0
arch/riscv/kernel/sys_riscv.c SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end, · line 76
Quoted 8 lines
arch/riscv/kernel/sys_riscv.c +1
-1@@ -70,7 +70,7 @@ SYSCALL_DEFINE3(riscv_flush_icache, uintptr_t, start, uintptr_t, end,bool local = (flags &SYS_RISCV_FLUSH_ICACHE_LOCAL ) !=0 ;/* Check the reserved flags. */ -if (unlikely (flags & !SYS_RISCV_FLUSH_ICACHE_ALL )) +if (unlikely (flags & ~SYS_RISCV_FLUSH_ICACHE_ALL ))return -EINVAL ;flush_icache_mm (mm, local);
Thanks!