linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
To: linuxppc-dev@ozlabs.org
Cc: mikey@neuling.org, sukadev@linux.vnet.ibm.com, dja@axtens.net,
	mpe@ellerman.id.au
Subject: [PATCH 2/5] powerpc/perf: Change type of the bhrb_users variable
Date: Tue, 30 Jun 2015 13:50:28 +0530	[thread overview]
Message-ID: <1435652431-22024-3-git-send-email-khandual@linux.vnet.ibm.com> (raw)
In-Reply-To: <1435652431-22024-1-git-send-email-khandual@linux.vnet.ibm.com>

This patch just changes data type of bhrb_users variable from
int to unsigned int because it never contains a negative value.

Reported-by: Daniel Axtens <dja@axtens.net>
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
 arch/powerpc/perf/core-book3s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index b0c2d53..f9ecd93 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -53,7 +53,7 @@ struct cpu_hw_events {
 
 	/* BHRB bits */
 	u64				bhrb_filter;	/* BHRB HW branch filter */
-	int				bhrb_users;
+	unsigned int			bhrb_users;
 	void				*bhrb_context;
 	struct	perf_branch_stack	bhrb_stack;
 	struct	perf_branch_entry	bhrb_entries[BHRB_MAX_ENTRIES];
@@ -369,8 +369,8 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
 	if (!ppmu->bhrb_nr)
 		return;
 
+	WARN_ON_ONCE(!cpuhw->bhrb_users);
 	cpuhw->bhrb_users--;
-	WARN_ON_ONCE(cpuhw->bhrb_users < 0);
 	perf_sched_cb_dec(event->ctx->pmu);
 
 	if (!cpuhw->disabled && !cpuhw->bhrb_users) {
-- 
2.1.0

  parent reply	other threads:[~2015-06-30  8:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30  8:20 [PATCH 0/5] BHRB fixes, improvements and cleanups Anshuman Khandual
2015-06-30  8:20 ` [PATCH 1/5] powerpc/perf: Drop the branch sample when 'from' cannot be fetched Anshuman Khandual
2015-07-27  4:19   ` [1/5] " Michael Ellerman
2015-07-28  3:08     ` Anshuman Khandual
2015-09-30  9:03       ` Anshuman Khandual
2015-09-30 10:46         ` Michael Ellerman
2015-06-30  8:20 ` Anshuman Khandual [this message]
2015-08-03  1:35   ` [2/5] powerpc/perf: Change type of the bhrb_users variable Michael Ellerman
2015-06-30  8:20 ` [PATCH 3/5] powerpc/perf: Replace last usage of get_cpu_var with this_cpu_ptr Anshuman Khandual
2015-07-27  5:15   ` [3/5] " Michael Ellerman
2015-07-28  3:37     ` Anshuman Khandual
2015-06-30  8:20 ` [PATCH 4/5] powerpc/perf: Change name & type of 'pred' in power_pmu_bhrb_read Anshuman Khandual
2015-07-29  3:25   ` [4/5] " Michael Ellerman
2015-07-29  8:13     ` Anshuman Khandual
2015-06-30  8:20 ` [PATCH 5/5] powerpc/perf: Re organize PMU branch filter processing on POWER8 Anshuman Khandual

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=1435652431-22024-3-git-send-email-khandual@linux.vnet.ibm.com \
    --to=khandual@linux.vnet.ibm.com \
    --cc=dja@axtens.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=mpe@ellerman.id.au \
    --cc=sukadev@linux.vnet.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).