Skip to content

Commit

Permalink
efi/libstub: Cast away type warning in use of max()
Browse files Browse the repository at this point in the history
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 <ardb@kernel.org>
  • Loading branch information
ardbiesheuvel committed Mar 28, 2024
1 parent d21f5a5 commit 61d130f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/firmware/efi/libstub/randomalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 61d130f

Please sign in to comment.