[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211229211009.108091-7-linux@dominikbrodowski.net>
Date: Wed, 29 Dec 2021 22:10:09 +0100
From: Dominik Brodowski <linux@...inikbrodowski.net>
To: "Jason A . Donenfeld" <Jason@...c4.com>
Cc: linux-kernel@...r.kernel.org, Theodore Ts'o <tytso@....edu>,
"Ivan T . Ivanov" <iivanov@...e.de>,
Ard Biesheuvel <ardb@...nel.org>, linux-efi@...r.kernel.org,
linux@...inikbrodowski.net
Subject: [PATCH v8 7/7] random: move crng_initialize_secondary to CONFIG_NUMA section
By moving crng_initialize_secondary() a few lines lower to the
CONFIG_NUMA ifdef section, we can remove the __maybe_unused parameter.
Suggested-by: Jason A. Donenfeld <Jason@...c4.com>
Signed-off-by: Dominik Brodowski <linux@...inikbrodowski.net>
---
drivers/char/random.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index a5bf662578cb..64949c43f588 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -819,14 +819,6 @@ static bool __init crng_init_try_arch_early(struct crng_state *crng)
return arch_init;
}
-static void __maybe_unused crng_initialize_secondary(struct crng_state *crng)
-{
- chacha_init_consts(crng->state);
- _get_random_bytes(&crng->state[4], sizeof(__u32) * 12);
- crng_init_try_arch(crng);
- crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
-}
-
static void __init crng_initialize_primary(void)
{
struct crng_state *crng = &primary_crng;
@@ -871,6 +863,14 @@ static void crng_finalize_init(struct crng_state *crng)
}
#ifdef CONFIG_NUMA
+static void crng_initialize_secondary(struct crng_state *crng)
+{
+ chacha_init_consts(crng->state);
+ _get_random_bytes(&crng->state[4], sizeof(__u32) * 12);
+ crng_init_try_arch(crng);
+ crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
+}
+
static void do_numa_crng_init(struct work_struct *work)
{
int i;
--
2.34.1
Powered by blists - more mailing lists