powerpc/perf: Change type of the bhrb_users variable
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>
Tue, 30 Jun 2015 08:20:28 +0000 (13:50 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 27 Jul 2015 04:31:44 +0000 (14:31 +1000)
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>
arch/powerpc/perf/core-book3s.c

index d90893b76e7ceb51b5741d50d2d06fe873ee6af4..b0382f3f1095589a599c92d1a6eb25904a988304 100644 (file)
@@ -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) {