Commit f0322f7f authored by Anshuman Khandual's avatar Anshuman Khandual Committed by Michael Ellerman

powerpc/perf: Change type of the bhrb_users variable

This patch just changes data type of bhrb_users variable from
int to unsigned int because it never contains a negative value.
Reported-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarAnshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 465345ca
...@@ -53,7 +53,7 @@ struct cpu_hw_events { ...@@ -53,7 +53,7 @@ struct cpu_hw_events {
/* BHRB bits */ /* BHRB bits */
u64 bhrb_filter; /* BHRB HW branch filter */ u64 bhrb_filter; /* BHRB HW branch filter */
int bhrb_users; unsigned int bhrb_users;
void *bhrb_context; void *bhrb_context;
struct perf_branch_stack bhrb_stack; struct perf_branch_stack bhrb_stack;
struct perf_branch_entry bhrb_entries[BHRB_MAX_ENTRIES]; struct perf_branch_entry bhrb_entries[BHRB_MAX_ENTRIES];
...@@ -369,8 +369,8 @@ static void power_pmu_bhrb_disable(struct perf_event *event) ...@@ -369,8 +369,8 @@ static void power_pmu_bhrb_disable(struct perf_event *event)
if (!ppmu->bhrb_nr) if (!ppmu->bhrb_nr)
return; return;
WARN_ON_ONCE(!cpuhw->bhrb_users);
cpuhw->bhrb_users--; cpuhw->bhrb_users--;
WARN_ON_ONCE(cpuhw->bhrb_users < 0);
perf_sched_cb_dec(event->ctx->pmu); perf_sched_cb_dec(event->ctx->pmu);
if (!cpuhw->disabled && !cpuhw->bhrb_users) { if (!cpuhw->disabled && !cpuhw->bhrb_users) {
......
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