]> git.hungrycats.org Git - linux/commitdiff
efi/libstub: Cast away type warning in use of max()
authorArd Biesheuvel <ardb@kernel.org>
Tue, 26 Mar 2024 10:15:25 +0000 (11:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2024 13:19:48 +0000 (15:19 +0200)
commit 61d130f261a3c15ae2c4b6f3ac3517d5d5b78855 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/libstub/randomalloc.c

index 0d7b11b55ff31307b05749ab27f37ab4d3ec9065..fff826f56728ccd85628dac969f85a3d1fd4ff93 100644 (file)
@@ -119,7 +119,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,