From: zhouchuangao Date: Tue, 30 Mar 2021 11:57:50 +0000 (-0700) Subject: arm64/kernel/probes: Use BUG_ON instead of if condition followed by BUG. X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=839157876f97fcc7ead0b62c9377bb50f75a3df9;p=linux.git arm64/kernel/probes: Use BUG_ON instead of if condition followed by BUG. It can be optimized at compile time. Signed-off-by: zhouchuangao Reviewed-by: Masami Hiramatsu Link: https://lore.kernel.org/r/1617105472-6081-1-git-send-email-zhouchuangao@vivo.com Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index 66aac2881ba84..ecf0f613327f4 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -264,8 +264,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) * normal page fault. */ instruction_pointer_set(regs, (unsigned long) cur->addr); - if (!instruction_pointer(regs)) - BUG(); + BUG_ON(!instruction_pointer(regs)); if (kcb->kprobe_status == KPROBE_REENTER) restore_previous_kprobe(kcb);