Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 8/8] ARM: hw_breakpoint: kill WARN_ONCE usage
Date: Fri, 26 Oct 2012 11:30:15 +0100	[thread overview]
Message-ID: <1351247415-25090-8-git-send-email-will.deacon@arm.com> (raw)
In-Reply-To: <1351247415-25090-1-git-send-email-will.deacon@arm.com>

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>
---
 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 05febba..5ff2e77 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)
 
 	/* Check that the write made it through. */
 	ARM_DBG_READ(c0, c1, 0, dscr);
-	if (WARN_ONCE(!(dscr & ARM_DSCR_MDBGEN),
-		"Failed to enable monitor mode on CPU %d.\n",
-		smp_processor_id()))
+	if (!(dscr & ARM_DSCR_MDBGEN)) {
+		pr_warn_once("Failed to enable monitor mode on CPU %d.\n",
+				smp_processor_id());
 		return -EPERM;
+	}
 
 out:
 	return 0;
@@ -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;
+	}
 
 	/* Override the breakpoint data with the step data. */
 	if (info->step_ctrl.enabled) {
@@ -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;
+	}
 
 	/* Ensure that we disable the mismatch breakpoint. */
 	if (info->ctrl.type != ARM_BREAKPOINT_EXECUTE &&
-- 
1.7.4.1

      parent reply	other threads:[~2012-10-26 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 10:30 [PATCH v2 1/8] ARM: hw_breakpoint: only clear OS lock when implemented on v7 Will Deacon
2012-10-26 10:30 ` [PATCH v2 2/8] ARM: hw_breakpoint: fix monitor mode detection with v7.1 Will Deacon
2012-10-26 10:30 ` [PATCH v2 3/8] ARM: hw_breakpoint: fix ordering of debug register reset sequence Will Deacon
2012-10-26 10:30 ` [PATCH v2 4/8] ARM: hw_breakpoint: don't try to clear v6 debug registers during boot Will Deacon
2012-10-26 10:30 ` [PATCH v2 5/8] ARM: hw_breakpoint: make boot quieter without CPUID feature registers Will Deacon
2012-10-26 10:30 ` [PATCH v2 6/8] ARM: hw_breakpoint: check if monitor mode is enabled during validation Will Deacon
2012-10-26 10:30 ` [PATCH v2 7/8] ARM: hw_breakpoint: use CRn as argument for debug reg accessor macros Will Deacon
2012-10-26 10:30 ` Will Deacon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1351247415-25090-8-git-send-email-will.deacon@arm.com \
    --to=will.deacon@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox