kernel: random: ifdef z_early_boot_rand_get

This function had a to sys_rand_get() even without random source. As
Zephyr is built with linkage garbage collection and this function is
called only if either ENTROPY_HAS_DRIVER or TEST_RANDOM_GENERATOR is
enabled and these options automatically enable a random source.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2020-02-14 16:35:54 -08:00 committed by Johan Hedberg
commit 8ae822c9fa

View file

@ -424,6 +424,7 @@ static FUNC_NORETURN void switch_to_main_thread(void)
}
#endif /* CONFIG_MULTITHREADING */
#if defined(CONFIG_ENTROPY_HAS_DRIVER) || defined(CONFIG_TEST_RANDOM_GENERATOR)
void z_early_boot_rand_get(u8_t *buf, size_t length)
{
int n = sizeof(u32_t);
@ -479,6 +480,8 @@ sys_rand_fallback:
length -= n;
}
}
/* defined(CONFIG_ENTROPY_HAS_DRIVER) || defined(CONFIG_TEST_RANDOM_GENERATOR) */
#endif
/**
*