aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2024-03-26 11:15:25 +0100
committerArd Biesheuvel <ardb@kernel.org>2024-03-28 16:18:57 +0100
commit61d130f261a3c15ae2c4b6f3ac3517d5d5b78855 (patch)
treeac28a8ec49cb6c394d1a952dac38a12948b9824e
parentd21f5a59ea773826cc489acb287811d690b703cc (diff)
downloadwq-61d130f261a3c15ae2c4b6f3ac3517d5d5b78855.tar.gz
efi/libstub: Cast away type warning in use of max()
Avoid a type mismatch warning in max() by switching to max_t() and providing the type explicitly. Fixes: 3cb4a4827596abc82e ("efi/libstub: fix efi_random_alloc() ...") Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/libstub/randomalloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/randomalloc.c b/drivers/firmware/efi/libstub/randomalloc.c
index 7e185285955021..c41e7b2091cdd1 100644
--- a/drivers/firmware/efi/libstub/randomalloc.c
+++ b/drivers/firmware/efi/libstub/randomalloc.c
@@ -120,7 +120,7 @@ efi_status_t efi_random_alloc(unsigned long size,
continue;
}
- target = round_up(max(md->phys_addr, alloc_min), align) + target_slot * align;
+ target = round_up(max_t(u64, md->phys_addr, alloc_min), align) + target_slot * align;
pages = size / EFI_PAGE_SIZE;
status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,