diff options
author | Will Deacon <will.deacon@arm.com> | 2012-10-25 12:18:23 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2012-11-09 06:47:06 -0500 |
commit | f435ab79928e4d54082e2838c4562a165e37999c (patch) | |
tree | 73964ce863bdc7b8e2eb0807ab5e18570437bfff | |
parent | 9e962f76602dbd293a57030f4ce5a4b57853e2ea (diff) |
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: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r-- | arch/arm/kernel/hw_breakpoint.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm/kernel/hw_breakpoint.c b/arch/arm/kernel/hw_breakpoint.c index 05febbaecb44..5ff2e77782b1 100644 --- a/arch/arm/kernel/hw_breakpoint.c +++ b/arch/arm/kernel/hw_breakpoint.c | |||
@@ -261,10 +261,11 @@ static int enable_monitor_mode(void) | |||
261 | 261 | ||
262 | /* Check that the write made it through. */ | 262 | /* Check that the write made it through. */ |
263 | ARM_DBG_READ(c0, c1, 0, dscr); | 263 | ARM_DBG_READ(c0, c1, 0, dscr); |
264 | if (WARN_ONCE(!(dscr & ARM_DSCR_MDBGEN), | 264 | if (!(dscr & ARM_DSCR_MDBGEN)) { |
265 | "Failed to enable monitor mode on CPU %d.\n", | 265 | pr_warn_once("Failed to enable monitor mode on CPU %d.\n", |
266 | smp_processor_id())) | 266 | smp_processor_id()); |
267 | return -EPERM; | 267 | return -EPERM; |
268 | } | ||
268 | 269 | ||
269 | out: | 270 | out: |
270 | return 0; | 271 | return 0; |
@@ -357,8 +358,10 @@ int arch_install_hw_breakpoint(struct perf_event *bp) | |||
357 | } | 358 | } |
358 | } | 359 | } |
359 | 360 | ||
360 | if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n")) | 361 | if (i == max_slots) { |
362 | pr_warning("Can't find any breakpoint slot\n"); | ||
361 | return -EBUSY; | 363 | return -EBUSY; |
364 | } | ||
362 | 365 | ||
363 | /* Override the breakpoint data with the step data. */ | 366 | /* Override the breakpoint data with the step data. */ |
364 | if (info->step_ctrl.enabled) { | 367 | if (info->step_ctrl.enabled) { |
@@ -407,8 +410,10 @@ void arch_uninstall_hw_breakpoint(struct perf_event *bp) | |||
407 | } | 410 | } |
408 | } | 411 | } |
409 | 412 | ||
410 | if (WARN_ONCE(i == max_slots, "Can't find any breakpoint slot\n")) | 413 | if (i == max_slots) { |
414 | pr_warning("Can't find any breakpoint slot\n"); | ||
411 | return; | 415 | return; |
416 | } | ||
412 | 417 | ||
413 | /* Ensure that we disable the mismatch breakpoint. */ | 418 | /* Ensure that we disable the mismatch breakpoint. */ |
414 | if (info->ctrl.type != ARM_BREAKPOINT_EXECUTE && | 419 | if (info->ctrl.type != ARM_BREAKPOINT_EXECUTE && |