summaryrefslogtreecommitdiffstats
path: root/lib/percpu_counter.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-01-29 07:35:19 +0100
committerTakashi Iwai <tiwai@suse.de>2014-01-29 07:35:19 +0100
commita31886669f6277a8576af6e917c3958c780a4ebf (patch)
tree195338489a866f54af718a67122150bd78c5cc42 /lib/percpu_counter.c
parentALSA: hda - Fix silent output on MacBook Air 1,1 (diff)
parentMerge remote-tracking branches 'asoc/fix/arizona', 'asoc/fix/fsl', 'asoc/fix/... (diff)
downloadlinux-a31886669f6277a8576af6e917c3958c780a4ebf.tar.xz
linux-a31886669f6277a8576af6e917c3958c780a4ebf.zip
Merge tag 'asoc-v3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.14 A few fixes, all in drivers. Nothing stands out particularly, the biggest set of fixes is some build coverage issues from Sachin.
Diffstat (limited to 'lib/percpu_counter.c')
-rw-r--r--lib/percpu_counter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/percpu_counter.c b/lib/percpu_counter.c
index 7473ee3b4ee7..8280a5dd1727 100644
--- a/lib/percpu_counter.c
+++ b/lib/percpu_counter.c
@@ -82,10 +82,10 @@ void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch)
unsigned long flags;
raw_spin_lock_irqsave(&fbc->lock, flags);
fbc->count += count;
+ __this_cpu_sub(*fbc->counters, count - amount);
raw_spin_unlock_irqrestore(&fbc->lock, flags);
- __this_cpu_write(*fbc->counters, 0);
} else {
- __this_cpu_write(*fbc->counters, count);
+ this_cpu_add(*fbc->counters, amount);
}
preempt_enable();
}