projects
/
platform
/
kernel
/
linux-rpi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
btrfs: fix race between quota disable and quota assign ioctls
[platform/kernel/linux-rpi.git]
/
lib
/
random32.c
diff --git
a/lib/random32.c
b/lib/random32.c
index
4d0e05e
..
f0ab17c
100644
(file)
--- a/
lib/random32.c
+++ b/
lib/random32.c
@@
-39,8
+39,9
@@
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/bitops.h>
#include <linux/random.h>
#include <linux/sched.h>
#include <linux/bitops.h>
+#include <linux/slab.h>
+#include <linux/notifier.h>
#include <asm/unaligned.h>
#include <asm/unaligned.h>
-#include <trace/events/random.h>
/**
* prandom_u32_state - seeded pseudo-random number generator.
/**
* prandom_u32_state - seeded pseudo-random number generator.
@@
-386,7
+387,6
@@
u32 prandom_u32(void)
struct siprand_state *state = get_cpu_ptr(&net_rand_state);
u32 res = siprand_u32(state);
struct siprand_state *state = get_cpu_ptr(&net_rand_state);
u32 res = siprand_u32(state);
- trace_prandom_u32(res);
put_cpu_ptr(&net_rand_state);
return res;
}
put_cpu_ptr(&net_rand_state);
return res;
}
@@
-552,9
+552,11
@@
static void prandom_reseed(struct timer_list *unused)
* To avoid worrying about whether it's safe to delay that interrupt
* long enough to seed all CPUs, just schedule an immediate timer event.
*/
* To avoid worrying about whether it's safe to delay that interrupt
* long enough to seed all CPUs, just schedule an immediate timer event.
*/
-static void prandom_timer_start(struct random_ready_callback *unused)
+static int prandom_timer_start(struct notifier_block *nb,
+ unsigned long action, void *data)
{
mod_timer(&seed_timer, jiffies);
{
mod_timer(&seed_timer, jiffies);
+ return 0;
}
#ifdef CONFIG_RANDOM32_SELFTEST
}
#ifdef CONFIG_RANDOM32_SELFTEST
@@
-618,13
+620,13
@@
core_initcall(prandom32_state_selftest);
*/
static int __init prandom_init_late(void)
{
*/
static int __init prandom_init_late(void)
{
- static struct
random_ready_callba
ck random_ready = {
- .
func
= prandom_timer_start
+ static struct
notifier_blo
ck random_ready = {
+ .
notifier_call
= prandom_timer_start
};
};
- int ret =
add_random_ready_callback
(&random_ready);
+ int ret =
register_random_ready_notifier
(&random_ready);
if (ret == -EALREADY) {
if (ret == -EALREADY) {
- prandom_timer_start(&random_ready);
+ prandom_timer_start(&random_ready
, 0, NULL
);
ret = 0;
}
return ret;
ret = 0;
}
return ret;