diff options
author | David S. Miller <davem@davemloft.net> | 2012-08-17 12:09:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-19 08:26:20 +0200 |
commit | 5ab968413515e17788003c522f7ca40a07fae900 (patch) | |
tree | 8af29c455d3469ea6af3086a303962f92c65ef1f /arch/sparc/kernel/perf_event.c | |
parent | sparc64: Prepare perf event layer for handling multiple PCR registers. (diff) | |
download | linux-5ab968413515e17788003c522f7ca40a07fae900.tar.xz linux-5ab968413515e17788003c522f7ca40a07fae900.zip |
sparc64: Rework sparc_pmu_enable() so that the side effects are clearer.
When cpuc->n_events is zero, we actually don't do anything and we just
write the cpuc->pcr[0] value as-is without any modifications.
The "pcr = 0;" assignment there was just useless and confusing.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/perf_event.c')
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 9be089abb5d1..197c79e9206a 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c @@ -752,7 +752,6 @@ out: static void sparc_pmu_enable(struct pmu *pmu) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); - u64 pcr; if (cpuc->enabled) return; @@ -760,11 +759,8 @@ static void sparc_pmu_enable(struct pmu *pmu) cpuc->enabled = 1; barrier(); - pcr = cpuc->pcr[0]; - if (!cpuc->n_events) { - pcr = 0; - } else { - pcr = maybe_change_configuration(cpuc, pcr); + if (cpuc->n_events) { + u64 pcr = maybe_change_configuration(cpuc, cpuc->pcr[0]); /* We require that all of the events have the same * configuration, so just fetch the settings from the |