Skip to content

Commit 6e9070d

Browse files
intel-lab-lkppalmer-dabbelt
authored andcommitted
riscv: fix bugon.cocci warnings
Use BUG_ON instead of a if condition followed by BUG. Generated by: scripts/coccinelle/misc/bugon.cocci Fixes: c22b0bc ("riscv: Add kprobes supported") CC: Guo Ren <guoren@linux.alibaba.com> Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: kernel test robot <lkp@intel.com> Signed-off-by: Julia Lawall <julia.lawall@inria.fr> Reviewed-by: Pekka Enberg <penberg@kernel.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
1 parent 0d7588a commit 6e9070d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

arch/riscv/kernel/probes/kprobes.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr)
256256
* normal page fault.
257257
*/
258258
regs->epc = (unsigned long) cur->addr;
259-
if (!instruction_pointer(regs))
260-
BUG();
259+
BUG_ON(!instruction_pointer(regs));
261260

262261
if (kcb->kprobe_status == KPROBE_REENTER)
263262
restore_previous_kprobe(kcb);

0 commit comments

Comments
 (0)