Skip to content

Commit 61d130f

Browse files
committed
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: 3cb4a48 ("efi/libstub: fix efi_random_alloc() ...") Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent d21f5a5 commit 61d130f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/libstub/randomalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ efi_status_t efi_random_alloc(unsigned long size,
120120
continue;
121121
}
122122

123-
target = round_up(max(md->phys_addr, alloc_min), align) + target_slot * align;
123+
target = round_up(max_t(u64, md->phys_addr, alloc_min), align) + target_slot * align;
124124
pages = size / EFI_PAGE_SIZE;
125125

126126
status = efi_bs_call(allocate_pages, EFI_ALLOCATE_ADDRESS,

0 commit comments

Comments
 (0)