]> git.baikalelectronics.ru Git - kernel.git/commit
efi/libstub: Move efi_random_alloc() into separate source file
authorArd Biesheuvel <ardb@kernel.org>
Mon, 10 Feb 2020 16:02:41 +0000 (17:02 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 23 Feb 2020 20:57:15 +0000 (21:57 +0100)
commite8e3e9423d947b8529778a5e791fbe823d20154b
treeda8e8acfb3d3d2c1ca26cd918de2e21a9f1315d7
parent70e8dac872e4e2b4606b21cd233c30b2958cae98
efi/libstub: Move efi_random_alloc() into separate source file

efi_random_alloc() is only used on arm64, but as it shares a source
file with efi_random_get_seed(), the latter will pull in the former
on other architectures as well.

Let's take advantage of the fact that libstub is a static library,
and so the linker will only incorporate objects that are needed to
satisfy dependencies in other objects. This means we can move the
random alloc code to a separate source file that gets built
unconditionally, but only used when needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/Makefile
drivers/firmware/efi/libstub/random.c
drivers/firmware/efi/libstub/randomalloc.c [new file with mode: 0644]