]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: use MAX() where appropriate
authorLennart Poettering <lennart@poettering.net>
Thu, 22 Aug 2024 16:20:20 +0000 (18:20 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 22 Aug 2024 20:26:35 +0000 (05:26 +0900)
src/boot/efi/linux_x86.c

index 369752e3ea9d9ed4b470e6b39f69158ef86c813e..ddae4d160a196add246ffc3633f98cfe5b9bd687 100644 (file)
@@ -164,7 +164,7 @@ EFI_STATUS linux_exec_efi_handover(
                 linux_relocated = xmalloc_pages(
                                 AllocateMaxAddress,
                                 EfiLoaderCode,
-                                EFI_SIZE_TO_PAGES(kernel_size_in_memory > kernel->iov_len ? kernel_size_in_memory : kernel->iov_len),
+                                EFI_SIZE_TO_PAGES(MAX(kernel_size_in_memory, kernel->iov_len)),
                                 UINT32_MAX);
                 linux_buffer = memcpy(
                                 PHYSICAL_ADDRESS_TO_POINTER(linux_relocated.addr), kernel->iov_base, kernel->iov_len);