Skip to content

Commit 3c35d1a

Browse files
Alexandre Ghitipalmer-dabbelt
authored andcommitted
libstub: Fix compilation warning for rv32
Fix the following warning which appears when compiled for rv32 by using unsigned long type instead of u64. ../drivers/firmware/efi/libstub/efi-stub-helper.c: In function 'efi_kaslr_relocate_kernel': ../drivers/firmware/efi/libstub/efi-stub-helper.c:846:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 846 | (u64)_end < EFI_ALLOC_LIMIT) { Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Tested-by: Conor Dooley <conor.dooley@microchip.com> Tested-by: Song Shuai <songshuaishuai@tinylab.org> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Tested-by: Sami Tolvanen <samitolvanen@google.com> Link: https://lore.kernel.org/r/20230722123850.634544-5-alexghiti@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 6b56beb commit 3c35d1a

File tree

1 file changed

+1
-1
lines changed
  • drivers/firmware/efi/libstub

1 file changed

+1
-1
lines changed

drivers/firmware/efi/libstub/kaslr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ efi_status_t efi_kaslr_relocate_kernel(unsigned long *image_addr,
130130
if (!check_image_region(*image_addr, kernel_memsize)) {
131131
efi_err("FIRMWARE BUG: Image BSS overlaps adjacent EFI memory region\n");
132132
} else if (IS_ALIGNED(*image_addr, min_kimg_align) &&
133-
(u64)_end < EFI_ALLOC_LIMIT) {
133+
(unsigned long)_end < EFI_ALLOC_LIMIT) {
134134
/*
135135
* Just execute from wherever we were loaded by the
136136
* UEFI PE/COFF loader if the placement is suitable.

0 commit comments

Comments
 (0)