diff options
Diffstat (limited to 'lib/random32.c')
| -rw-r--r-- | lib/random32.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/random32.c b/lib/random32.c index 510d1ce7d4d2..fa594b1140e6 100644 --- a/lib/random32.c +++ b/lib/random32.c | |||
| @@ -47,7 +47,7 @@ static inline void prandom_state_selftest(void) | |||
| 47 | } | 47 | } |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | static DEFINE_PER_CPU(struct rnd_state, net_rand_state); | 50 | static DEFINE_PER_CPU(struct rnd_state, net_rand_state) __latent_entropy; |
| 51 | 51 | ||
| 52 | /** | 52 | /** |
| 53 | * prandom_u32_state - seeded pseudo-random number generator. | 53 | * prandom_u32_state - seeded pseudo-random number generator. |
| @@ -81,7 +81,7 @@ u32 prandom_u32(void) | |||
| 81 | u32 res; | 81 | u32 res; |
| 82 | 82 | ||
| 83 | res = prandom_u32_state(state); | 83 | res = prandom_u32_state(state); |
| 84 | put_cpu_var(state); | 84 | put_cpu_var(net_rand_state); |
| 85 | 85 | ||
| 86 | return res; | 86 | return res; |
| 87 | } | 87 | } |
| @@ -128,7 +128,7 @@ void prandom_bytes(void *buf, size_t bytes) | |||
| 128 | struct rnd_state *state = &get_cpu_var(net_rand_state); | 128 | struct rnd_state *state = &get_cpu_var(net_rand_state); |
| 129 | 129 | ||
| 130 | prandom_bytes_state(state, buf, bytes); | 130 | prandom_bytes_state(state, buf, bytes); |
| 131 | put_cpu_var(state); | 131 | put_cpu_var(net_rand_state); |
| 132 | } | 132 | } |
| 133 | EXPORT_SYMBOL(prandom_bytes); | 133 | EXPORT_SYMBOL(prandom_bytes); |
| 134 | 134 | ||
| @@ -233,7 +233,6 @@ static void __prandom_timer(unsigned long dontcare) | |||
| 233 | 233 | ||
| 234 | static void __init __prandom_start_seed_timer(void) | 234 | static void __init __prandom_start_seed_timer(void) |
| 235 | { | 235 | { |
| 236 | set_timer_slack(&seed_timer, HZ); | ||
| 237 | seed_timer.expires = jiffies + msecs_to_jiffies(40 * MSEC_PER_SEC); | 236 | seed_timer.expires = jiffies + msecs_to_jiffies(40 * MSEC_PER_SEC); |
| 238 | add_timer(&seed_timer); | 237 | add_timer(&seed_timer); |
| 239 | } | 238 | } |
