diff options
| author | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-06-13 10:07:47 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 18:41:51 +0200 |
| commit | 7ccc3457dbe5b27b2de86d45f2e730f4f38cbce3 (patch) | |
| tree | 5eb092eb51194db7b1f102de7b42740761a021d4 /include/uapi/linux/virtio_config.h | |
| parent | e9993a9c6dc1274831e81ef4ff63ccccf1aa61d5 (diff) | |
random: avoid checking crng_ready() twice in random_init()
commit 9b29b6b20376ab64e1b043df6301d8a92378e631 upstream.
The current flow expands to:
if (crng_ready())
...
else if (...)
if (!crng_ready())
...
The second crng_ready() call is redundant, but can't so easily be
optimized out by the compiler.
This commit simplifies that to:
if (crng_ready()
...
else if (...)
...
Fixes: 560181c27b58 ("random: move initialization functions out of hot pages")
Cc: stable@vger.kernel.org
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/virtio_config.h')
0 files changed, 0 insertions, 0 deletions
