[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210402062149.98ad11a0ec940cef86122fc2@kernel.org>
Date: Fri, 2 Apr 2021 06:21:49 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: zhouchuangao <zhouchuangao@...o.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Qais Yousef <qais.yousef@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm64/kernel/probes: Use BUG_ON instead of if condition
followed by BUG.
On Tue, 30 Mar 2021 04:57:50 -0700
zhouchuangao <zhouchuangao@...o.com> wrote:
> It can be optimized at compile time.
>
Anyway, this seems to make the code simpler.
Reviewed-by: Masami Hiramatsu <mhiramat@...nel.org>
Thanks!
> Signed-off-by: zhouchuangao <zhouchuangao@...o.com>
> ---
> arch/arm64/kernel/probes/kprobes.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c
> index 66aac28..ecf0f61 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);
> --
> 2.7.4
>
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists