diff options
author | Christoph Lameter <cl@linux.com> | 2010-12-06 12:40:06 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-17 09:18:05 -0500 |
commit | b29c617af3b09d150d3889836c24d39564b39180 (patch) | |
tree | 17514cd85f64917e96d736b6dc5ac681dab93955 /drivers/char | |
parent | ee1be8626355e6a1f3f8c44e2351ff2661c5998d (diff) |
random: Use this_cpu_inc_return
__this_cpu_inc can create a single instruction to do the same as
__get_cpu_var()++.
Cc: Richard Kennedy <richard@rsk.demon.co.uk>
Cc: Matt Mackall <mpm@selenic.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/random.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 5a1aa64f4e7..72a4fcb1774 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -626,7 +626,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num) | |||
626 | preempt_disable(); | 626 | preempt_disable(); |
627 | /* if over the trickle threshold, use only 1 in 4096 samples */ | 627 | /* if over the trickle threshold, use only 1 in 4096 samples */ |
628 | if (input_pool.entropy_count > trickle_thresh && | 628 | if (input_pool.entropy_count > trickle_thresh && |
629 | (__get_cpu_var(trickle_count)++ & 0xfff)) | 629 | ((__this_cpu_inc_return(trickle_count) - 1) & 0xfff)) |
630 | goto out; | 630 | goto out; |
631 | 631 | ||
632 | sample.jiffies = jiffies; | 632 | sample.jiffies = jiffies; |