Skip to contentSkip to conversation

perf_counter: call atomic64_set for counter->count

PATCH In review Paul Mackerras 1 participant 2 messages May 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf_counter: call atomic64_set for counter->count

This fixes a compile warning where we are calling atomic_set(&counter->count). Since counter->count is an atomic64_t, we have to use atomic64_set.

[ Impact: fix type mismatch bug ]

---

kernel/perf_counter.c +1 -1
index 7373b96..5ea0240 100644
@@ -1281,7 +1281,7 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
 static void perf_counter_reset(struct perf_counter *counter)
 {
 	(void)perf_counter_read(counter);
-	atomic_set(&counter->count, 0);
+	atomic64_set(&counter->count, 0);
 	perf_counter_update_userpage(counter);
 }
 
#1 lore raw
Commit-ID:  615a3f1e055ac9b0ae74e1f935a12ea2cfe2a2ad
Gitweb:     http://git.kernel.org/tip/615a3f1e055ac9b0ae74e1f935a12ea2cfe2a2ad
Author:     Paul Mackerras <[email protected]>
AuthorDate: Mon, 11 May 2009 15:50:21 +1000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 11 May 2009 12:10:54 +0200

perf_counter: call atomic64_set for counter->count

A compile warning triggered because we are calling atomic_set(&counter->count). But since counter->count is an atomic64_t, we have to use atomic64_set.

So the count can be set short, resulting in the reset ioctl only resetting the low word.

[ Impact: clear counter properly during the reset ioctl ]

Cc Peter Zijlstra <[email protected]>
Cc Corey Ashford <[email protected]>

LKML-Reference: <[email protected]>

---
 kernel/perf_counter.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/perf_counter.c +1 -1
index 7373b96..5ea0240 100644
@@ -1281,7 +1281,7 @@ static unsigned int perf_poll(struct file *file, poll_table *wait)
 static void perf_counter_reset(struct perf_counter *counter)
 {
 	(void)perf_counter_read(counter);
-	atomic_set(&counter->count, 0);
+	atomic64_set(&counter->count, 0);
 	perf_counter_update_userpage(counter);
 }