Skip to content

Commit 44c6b69

Browse files
efi/libstub: Cast away type warning in use of max()
JIRA: https://issues.redhat.com/browse/RHEL-33066 commit 61d130f Author: Ard Biesheuvel <ardb@kernel.org> Date: Tue Mar 26 11:15:25 2024 +0100 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 <ardb@kernel.org> Signed-off-by: Lenny Szubowicz <lszubowi@redhat.com>
1 parent 7a5bd19 commit 44c6b69

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)