diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-05-12 08:12:30 +0200 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-05-12 08:12:30 +0200 |
commit | f1209c0da26fc54d8c567a039d7765b6ad23bd5b (patch) | |
tree | 2d80c67c8e2b22ce5ebee0f617c3c71b6763c8f2 /include/linux/random.h | |
parent | ff73aabd871910b44bea051e41c5024584b1061b (diff) | |
parent | 834b98d0367931d6bec5a48fe87fddd9b877f688 (diff) |
Merge branch 'tegra-nand-next' into tegra-next
Diffstat (limited to 'include/linux/random.h')
-rw-r--r-- | include/linux/random.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/include/linux/random.h b/include/linux/random.h index d13059f3ea32..fe0e2605af5d 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -64,10 +64,19 @@ extern const struct file_operations random_fops, urandom_fops; unsigned int get_random_int(void); unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); -u32 random32(void); -void srandom32(u32 seed); +u32 prandom_u32(void); +void prandom_bytes(void *buf, int nbytes); +void prandom_seed(u32 seed); -u32 prandom32(struct rnd_state *); +/* + * These macros are preserved for backward compatibility and should be + * removed as soon as a transition is finished. + */ +#define random32() prandom_u32() +#define srandom32(seed) prandom_seed(seed) + +u32 prandom_u32_state(struct rnd_state *); +void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); /* * Handle minimum values for seeds @@ -78,11 +87,11 @@ static inline u32 __seed(u32 x, u32 m) } /** - * prandom32_seed - set seed for prandom32(). + * prandom_seed_state - set seed for prandom_u32_state(). * @state: pointer to state structure to receive the seed. * @seed: arbitrary 64-bit value to use as a seed. */ -static inline void prandom32_seed(struct rnd_state *state, u64 seed) +static inline void prandom_seed_state(struct rnd_state *state, u64 seed) { u32 i = (seed >> 32) ^ (seed << 10) ^ seed; |