diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-09-28 18:47:30 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-09-29 21:37:27 +0200 |
commit | 585cd5fe9f7378601b1d4915ad6e9088333b5e5e (patch) | |
tree | dc9ebd5ca10e1341b6ec92bb75bdd0f9e9576485 /drivers/char | |
parent | utsname: contribute changes to RNG (diff) | |
download | linux-585cd5fe9f7378601b1d4915ad6e9088333b5e5e.tar.xz linux-585cd5fe9f7378601b1d4915ad6e9088333b5e5e.zip |
random: add 8-bit and 16-bit batches
There are numerous places in the kernel that would be sped up by having
smaller batches. Currently those callsites do `get_random_u32() & 0xff`
or similar. Since these are pretty spread out, and will require patches
to multiple different trees, let's get ahead of the curve and lay the
foundation for `get_random_u8()` and `get_random_u16()`, so that it's
then possible to start submitting conversion patches leisurely.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/random.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index f2aa3ab1b458..64ee16ffb8b7 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -506,6 +506,8 @@ EXPORT_SYMBOL(get_random_ ##type); DEFINE_BATCHED_ENTROPY(u64) DEFINE_BATCHED_ENTROPY(u32) +DEFINE_BATCHED_ENTROPY(u16) +DEFINE_BATCHED_ENTROPY(u8) #ifdef CONFIG_SMP /* |