forked from Minki/linux
random: convert to ENTROPY_BITS for better code readability
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Link: https://lore.kernel.org/r/20190607182517.28266-2-tiny.windzz@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
870e05b1b1
commit
12faac30d1
@ -760,7 +760,7 @@ retry:
|
||||
if (entropy_bits < 128)
|
||||
return;
|
||||
crng_reseed(&primary_crng, r);
|
||||
entropy_bits = r->entropy_count >> ENTROPY_SHIFT;
|
||||
entropy_bits = ENTROPY_BITS(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1378,8 +1378,7 @@ retry:
|
||||
goto retry;
|
||||
|
||||
trace_debit_entropy(r->name, 8 * ibytes);
|
||||
if (ibytes &&
|
||||
(r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) {
|
||||
if (ibytes && ENTROPY_BITS(r) < random_write_wakeup_bits) {
|
||||
wake_up_interruptible(&random_write_wait);
|
||||
kill_fasync(&fasync, SIGIO, POLL_OUT);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user