From: Jan Janssen Date: Mon, 20 Jun 2022 11:10:41 +0000 (+0200) Subject: boot: Use void for base pointer X-Git-Tag: v252-rc1~712^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=008f47f139be1ebf2b88b0dc94fe35b0059c8438;p=thirdparty%2Fsystemd.git boot: Use void for base pointer --- diff --git a/src/boot/efi/pe.c b/src/boot/efi/pe.c index 4a06268a429..4af6f7cfd52 100644 --- a/src/boot/efi/pe.c +++ b/src/boot/efi/pe.c @@ -247,11 +247,7 @@ EFI_STATUS pe_alignment_info( return EFI_SUCCESS; } -EFI_STATUS pe_memory_locate_sections( - const char *base, - const char **sections, - UINTN *addrs, - UINTN *sizes) { +EFI_STATUS pe_memory_locate_sections(const void *base, const char **sections, UINTN *addrs, UINTN *sizes) { const struct DosFileHeader *dos; const struct PeFileHeader *pe; UINTN offset; @@ -261,17 +257,21 @@ EFI_STATUS pe_memory_locate_sections( assert(addrs); assert(sizes); - dos = (const struct DosFileHeader*)base; + dos = (const struct DosFileHeader *) base; if (!verify_dos(dos)) return EFI_LOAD_ERROR; - pe = (const struct PeFileHeader*)&base[dos->ExeHeader]; + pe = (const struct PeFileHeader *) ((uint8_t *) base + dos->ExeHeader); if (!verify_pe(pe, /* allow_compatibility= */ false)) return EFI_LOAD_ERROR; offset = section_table_offset(dos, pe); - locate_sections((struct PeSectionHeader*)&base[offset], pe->FileHeader.NumberOfSections, - sections, addrs, NULL, sizes); + locate_sections((struct PeSectionHeader *) ((uint8_t *) base + offset), + pe->FileHeader.NumberOfSections, + sections, + addrs, + NULL, + sizes); return EFI_SUCCESS; } diff --git a/src/boot/efi/pe.h b/src/boot/efi/pe.h index 1a7ba51fe5f..3aad22e165e 100644 --- a/src/boot/efi/pe.h +++ b/src/boot/efi/pe.h @@ -5,7 +5,7 @@ #include EFI_STATUS pe_memory_locate_sections( - const char *base, + const void *base, const char **sections, UINTN *addrs, UINTN *sizes);