mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 15:20:41 +00:00
random: avoid warnings for !CONFIG_NUMA builds
commitab9a7e2704
upstream. As crng_initialize_secondary() is only called by do_numa_crng_init(), and the latter is under ifdeffery for CONFIG_NUMA, when CONFIG_NUMA is not selected the compiler will warn that the former is unused: | drivers/char/random.c:820:13: warning: 'crng_initialize_secondary' defined but not used [-Wunused-function] | 820 | static void crng_initialize_secondary(struct crng_state *crng) | | ^~~~~~~~~~~~~~~~~~~~~~~~~ Stephen reports that this happens for x86_64 noallconfig builds. We could move crng_initialize_secondary() and crng_init_try_arch() under the CONFIG_NUMA ifdeffery, but this has the unfortunate property of separating them from crng_initialize_primary() and crng_init_try_arch_early() respectively. Instead, let's mark crng_initialize_secondary() as __maybe_unused. Link: https://lore.kernel.org/r/20200310121747.GA49602@lakrids.cambridge.arm.com Fixes:5cbe0f13b5
("random: split primary/secondary crng init paths") Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b0a6d6a76a
commit
c5948834b0
1 changed files with 1 additions and 1 deletions
|
@ -800,7 +800,7 @@ static bool crng_init_try_arch(struct crng_state *crng)
|
|||
return arch_init;
|
||||
}
|
||||
|
||||
static void crng_initialize_secondary(struct crng_state *crng)
|
||||
static void __maybe_unused crng_initialize_secondary(struct crng_state *crng)
|
||||
{
|
||||
memcpy(&crng->state[0], "expand 32-byte k", 16);
|
||||
_get_random_bytes(&crng->state[4], sizeof(__u32) * 12);
|
||||
|
|
Loading…
Reference in a new issue