]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
random: use symbolic constants for crng_init states
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 8 May 2022 11:20:30 +0000 (13:20 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:11 +0000 (09:23 +0200)
commitf477e2183baaa0eab409a6771589fbe0fcf366bd
treed6872e5e554d7814ccac11cb209e6b3b0007a4fb
parent36dfc84763bcc24e9ac4ed4b64d9bcffd3235645
random: use symbolic constants for crng_init states

BugLink: https://bugs.launchpad.net/bugs/1981649
commit e3d2c5e79a999aa4e7d6f0127e16d3da5a4ff70d upstream.

crng_init represents a state machine, with three states, and various
rules for transitions. For the longest time, we've been managing these
with "0", "1", and "2", and expecting people to figure it out. To make
the code more obvious, replace these with proper enum values
representing the transition, and then redocument what each of these
states mean.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/char/random.c