From: Will Deacon Date: Tue, 26 Feb 2019 15:39:47 +0000 (+0000) Subject: arm64: debug: Clean up brk_handler() X-Git-Tag: v5.2-rc1~184^2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ab6211c90052435126ad1319e9223b68e154b9f0;p=thirdparty%2Fkernel%2Flinux.git arm64: debug: Clean up brk_handler() brk_handler() now looks pretty strange and can be refactored to drop its funny 'handler_found' local variable altogether. Reviewed-by: Mark Rutland Signed-off-by: Will Deacon --- diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 2692a0a27cf3a..800486cc48239 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c @@ -331,14 +331,12 @@ NOKPROBE_SYMBOL(call_break_hook); static int brk_handler(unsigned long unused, unsigned int esr, struct pt_regs *regs) { - bool handler_found = false; - - if (!handler_found && call_break_hook(regs, esr) == DBG_HOOK_HANDLED) - handler_found = true; + if (call_break_hook(regs, esr) == DBG_HOOK_HANDLED) + return 0; - if (!handler_found && user_mode(regs)) { + if (user_mode(regs)) { send_user_sigtrap(TRAP_BRKPT); - } else if (!handler_found) { + } else { pr_warn("Unexpected kernel BRK exception at EL1\n"); return -EFAULT; }