Skip to content

Commit dd7aa36

Browse files
committed
random: re-add removed comment about get_random_{u32,u64} reseeding
The comment about get_random_{u32,u64}() not invoking reseeding got added in an unrelated commit, that then was recently reverted by 0313bc2 ("Revert "random: block in /dev/urandom""). So this adds that little comment snippet back, and improves the wording a bit too. Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 parent d97c68d commit dd7aa36

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/char/random.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,10 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, void
224224
*
225225
* These interfaces will return the requested number of random bytes
226226
* into the given buffer or as a return value. This is equivalent to
227-
* a read from /dev/urandom. The integer family of functions may be
228-
* higher performance for one-off random integers, because they do a
229-
* bit of buffering.
227+
* a read from /dev/urandom. The u32, u64, int, and long family of
228+
* functions may be higher performance for one-off random integers,
229+
* because they do a bit of buffering and do not invoke reseeding
230+
* until the buffer is emptied.
230231
*
231232
*********************************************************************/
232233

0 commit comments

Comments
 (0)