Skip to content

Commit

Permalink
sparc: perf: Remove redundant perf_pmu_{en|dis}able calls
Browse files Browse the repository at this point in the history
perf_pmu_disable is called by core perf code before pmu->del and the
enable function is called by core perf code afterwards. No need to
call again within sparc_pmu_del.

Ditto for pmu->add and sparc_pmu_add.

Signed-off-by: David Ahern <david.ahern@oracle.com>
Acked-by: Bob Picco <bob.picco@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Ahern authored and David S. Miller committed Mar 20, 2015
1 parent b314aca commit 5b0d4b5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,6 @@ static void sparc_pmu_del(struct perf_event *event, int _flags)
int i;

local_irq_save(flags);
perf_pmu_disable(event->pmu);

for (i = 0; i < cpuc->n_events; i++) {
if (event == cpuc->event[i]) {
Expand All @@ -1127,7 +1126,6 @@ static void sparc_pmu_del(struct perf_event *event, int _flags)
}
}

perf_pmu_enable(event->pmu);
local_irq_restore(flags);
}

Expand Down Expand Up @@ -1361,7 +1359,6 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags)
unsigned long flags;

local_irq_save(flags);
perf_pmu_disable(event->pmu);

n0 = cpuc->n_events;
if (n0 >= sparc_pmu->max_hw_events)
Expand Down Expand Up @@ -1394,7 +1391,6 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags)

ret = 0;
out:
perf_pmu_enable(event->pmu);
local_irq_restore(flags);
return ret;
}
Expand Down

0 comments on commit 5b0d4b5

Please sign in to comment.