Skip to content

Commit

Permalink
powerpc/perf: Change type of the bhrb_users variable
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Anshuman Khandual authored and Michael Ellerman committed Jul 27, 2015
1 parent 465345c commit f0322f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/perf/core-book3s.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f0322f7

Please sign in to comment.