summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2019-02-26 15:39:47 +0000
committerWill Deacon <will.deacon@arm.com>2019-04-09 11:21:13 +0100
commitab6211c90052435126ad1319e9223b68e154b9f0 (patch)
tree79e185e74340fc38be622d3d2a0d0d126e5b8818
parent453b7740ebfda2d84be7fb583c54f0c91c592869 (diff)
downloadlinux-stable-ab6211c90052435126ad1319e9223b68e154b9f0.tar.gz
linux-stable-ab6211c90052435126ad1319e9223b68e154b9f0.tar.bz2
linux-stable-ab6211c90052435126ad1319e9223b68e154b9f0.zip
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 <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm64/kernel/debug-monitors.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c
index 2692a0a27cf3..800486cc4823 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;
}