Skip to contentSkip to conversation

perf_counter: Fix atomic_set vs. atomic64_t type mismatch

PATCH In review Paul Mackerras 1 participant 2 messages Jun 13, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf_counter: Fix atomic_set vs. atomic64_t type mismatch

Using atomic_set on an atomic64_t variable gives a compiler warning on powerpc, and won't give the desired result at runtime. This fixes an instance of this error in the perf_counter code.

---
 kernel/perf_counter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/perf_counter.c +1 -1
index 29b685f..8d14a73 100644
@@ -1283,7 +1283,7 @@ static void perf_ctx_adjust_freq(struct perf_counter_context *ctx)
 		if (!interrupts) {
 			perf_disable();
 			counter->pmu->disable(counter);
-			atomic_set(&hwc->period_left, 0);
+			atomic64_set(&hwc->period_left, 0);
 			counter->pmu->enable(counter);
 			perf_enable();
 		}
Signature · 1 line
1.6.0.4
#1 lore raw
Commit-ID:  87847b8f26cc7176ec9b239898dc7ce47a94e1a6
Gitweb:     http://git.kernel.org/tip/87847b8f26cc7176ec9b239898dc7ce47a94e1a6
Author:     Paul Mackerras <[email protected]>
AuthorDate: Sat, 13 Jun 2009 17:06:50 +1000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 13 Jun 2009 12:58:24 +0200

perf_counter: Fix atomic_set vs. atomic64_t type mismatch

Using atomic_set on an atomic64_t variable gives a compiler warning on powerpc, and won't give the desired result at runtime. This fixes an instance of this error in the perf_counter code.

LKML-Reference: <[email protected]>

---
 kernel/perf_counter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/perf_counter.c +1 -1
index 29b685f..8d14a73 100644
@@ -1283,7 +1283,7 @@ static void perf_ctx_adjust_freq(struct perf_counter_context *ctx)
 		if (!interrupts) {
 			perf_disable();
 			counter->pmu->disable(counter);
-			atomic_set(&hwc->period_left, 0);
+			atomic64_set(&hwc->period_left, 0);
 			counter->pmu->enable(counter);
 			perf_enable();
 		}