aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/random.c
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2008-04-29 01:03:03 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 08:06:25 -0700
commit6d38b827400d7c02bce391f90d044e4c57d5bc1e (patch)
tree826f378b9654d4e5b56d7e372c5d2d5eafd09c2f /drivers/char/random.c
parentrandom: eliminate redundant new_rotate variable (diff)
downloadlinux-dev-6d38b827400d7c02bce391f90d044e4c57d5bc1e.tar.xz
linux-dev-6d38b827400d7c02bce391f90d044e4c57d5bc1e.zip
random: remove some prefetch logic
The urandom output pool (ie the fast path) fits in one cacheline, so this is pretty unnecessary. Further, the output path has already fetched the entire pool to hash it before calling in here. (This was the only user of prefetch_range in the kernel, and it passed in words rather than bytes!) Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/random.c')
-rw-r--r--drivers/char/random.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 3823cb2e3b9a..a754132336ba 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -457,7 +457,7 @@ static void __add_entropy_words(struct entropy_store *r, const __u32 *in,
unsigned long i, add_ptr, tap1, tap2, tap3, tap4, tap5;
int input_rotate;
int wordmask = r->poolinfo->poolwords - 1;
- __u32 w, next_w;
+ __u32 w;
unsigned long flags;
/* Taps are constant, so we can load them without holding r->lock. */
@@ -466,17 +466,13 @@ static void __add_entropy_words(struct entropy_store *r, const __u32 *in,
tap3 = r->poolinfo->tap3;
tap4 = r->poolinfo->tap4;
tap5 = r->poolinfo->tap5;
- next_w = *in++;
spin_lock_irqsave(&r->lock, flags);
- prefetch_range(r->pool, wordmask);
input_rotate = r->input_rotate;
add_ptr = r->add_ptr;
while (nwords--) {
- w = rol32(next_w, input_rotate & 31);
- if (nwords > 0)
- next_w = *in++;
+ w = rol32(*in++, input_rotate & 31);
i = add_ptr = (add_ptr - 1) & wordmask;
/* XOR in the various taps */