Commit f435ab79 authored by Will Deacon's avatar Will Deacon

ARM: hw_breakpoint: kill WARN_ONCE usage

WARN_ONCE is a bit OTT for some of the simple failure cases encountered
in hw_breakpoint, so use either pr_warning or pr_warn_once instead.
Reported-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 9e962f76
...@@ -261,10 +261,11 @@ static int enable_monitor_mode(void) ...@@ -261,10 +261,11 @@ static int enable_monitor_mode(void)
/* Check that the write made it through. */ /* Check that the write made it through. */
ARM_DBG_READ(c0, c1, 0, dscr); ARM_DBG_READ(c0, c1, 0, dscr);
if (WARN_ONCE(!(dscr & ARM_DSCR_MDBGEN), if (!(dscr & ARM_DSCR_MDBGEN)) {
"Failed to enable monitor mode on CPU %d.\n", pr_warn_once("Failed to enable monitor mode on CPU %d.\n",
smp_processor_id())) smp_processor_id());
return -EPERM; return -EPERM;
}
out: out:
return 0; return 0;
...@@ -357,8 +358,10 @@ int arch_install_hw_breakpoint(struct perf_event *bp) ...@@ -357,8 +358,10 @@ int arch_install_hw_breakpoint(struct perf_event *bp)
} }
} }
if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n")) if (i == max_slots) {
pr_warning("Can't find any breakpoint slot\n");
return -EBUSY; return -EBUSY;
}
/* Override the breakpoint data with the step data. */ /* Override the breakpoint data with the step data. */
if (info->step_ctrl.enabled) { if (info->step_ctrl.enabled) {
...@@ -407,8 +410,10 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) ...@@ -407,8 +410,10 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp)
} }
} }
if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n")) if (i == max_slots) {
pr_warning("Can't find any breakpoint slot\n");
return; return;
}
/* Ensure that we disable the mismatch breakpoint. */ /* Ensure that we disable the mismatch breakpoint. */
if (info->ctrl.type != ARM_BREAKPOINT_EXECUTE && if (info->ctrl.type != ARM_BREAKPOINT_EXECUTE &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment