static bool is_sd_boot(EFI_FILE *root_dir, const char16_t *loader_path) {
EFI_STATUS err;
- const char *sections[] = {
+ static const char * const sections[] = {
".sdmagic",
NULL
};
continue;
/* look for .osrel and .cmdline sections in the .efi binary */
- err = pe_file_locate_sections(linux_dir, f->FileName, (const char **) sections, offs, szs);
+ err = pe_file_locate_sections(linux_dir, f->FileName, sections, offs, szs);
if (err != EFI_SUCCESS || szs[SECTION_OSREL] == 0)
continue;
static void locate_sections(
const struct PeSectionHeader section_table[],
UINTN n_table,
- const char **sections,
+ const char * const sections[],
UINTN *addrs,
UINTN *offsets,
UINTN *sizes) {
return EFI_SUCCESS;
}
-EFI_STATUS pe_memory_locate_sections(const void *base, const char **sections, UINTN *addrs, UINTN *sizes) {
+EFI_STATUS pe_memory_locate_sections(const void *base, const char * const sections[], UINTN *addrs, UINTN *sizes) {
const struct DosFileHeader *dos;
const struct PeFileHeader *pe;
UINTN offset;
EFI_STATUS pe_file_locate_sections(
EFI_FILE *dir,
const char16_t *path,
- const char **sections,
+ const char * const sections[],
UINTN *offsets,
UINTN *sizes) {
_cleanup_freepool_ struct PeSectionHeader *section_table = NULL;
EFI_STATUS pe_memory_locate_sections(
const void *base,
- const char **sections,
+ const char * const sections[],
UINTN *addrs,
UINTN *sizes);
EFI_STATUS pe_file_locate_sections(
EFI_FILE *dir,
const char16_t *path,
- const char **sections,
+ const char * const sections[],
UINTN *offsets,
UINTN *sizes);
if (err != EFI_SUCCESS)
return log_error_status_stall(err, L"Error getting a LoadedImageProtocol handle: %r", err);
- err = pe_memory_locate_sections(loaded_image->ImageBase, (const char **) sections, addrs, szs);
+ err = pe_memory_locate_sections(loaded_image->ImageBase, sections, addrs, szs);
if (err != EFI_SUCCESS || szs[SECTION_LINUX] == 0) {
if (err == EFI_SUCCESS)
err = EFI_NOT_FOUND;