projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hwmon: (via686a) Initialize fan_div values
[cascardo/linux.git]
/
lib
/
percpu_counter.c
diff --git
a/lib/percpu_counter.c
b/lib/percpu_counter.c
index
604678d
..
28f2c33
100644
(file)
--- a/
lib/percpu_counter.c
+++ b/
lib/percpu_counter.c
@@
-72,18
+72,16
@@
EXPORT_SYMBOL(percpu_counter_set);
void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
{
s64 count;
void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
{
s64 count;
- s32 *pcount;
preempt_disable();
preempt_disable();
- pcount = this_cpu_ptr(fbc->counters);
- count = *pcount + amount;
+ count = __this_cpu_read(*fbc->counters) + amount;
if (count >= batch || count <= -batch) {
spin_lock(&fbc->lock);
fbc->count += count;
if (count >= batch || count <= -batch) {
spin_lock(&fbc->lock);
fbc->count += count;
-
*pcount = 0
;
+
__this_cpu_write(*fbc->counters, 0)
;
spin_unlock(&fbc->lock);
} else {
spin_unlock(&fbc->lock);
} else {
-
*pcount = count
;
+
__this_cpu_write(*fbc->counters, count)
;
}
preempt_enable();
}
}
preempt_enable();
}