[PATCH 09/15] efi: payload: image: use new efi_phys_to_virt helper
Ahmad Fatoum
a.fatoum at barebox.org
Tue May 27 14:22:54 PDT 2025
Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
efi/payload/image.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/efi/payload/image.c b/efi/payload/image.c
index 70b57360c99d..20ef2a878c11 100644
--- a/efi/payload/image.c
+++ b/efi/payload/image.c
@@ -101,7 +101,7 @@ static void *efi_read_file(const char *file, size_t *size)
return NULL;
}
- buf = (void *)mem;
+ buf = efi_phys_to_virt(mem);
ret = read_file_into_buf(file, buf, s.st_size);
if (ret < 0)
@@ -113,7 +113,7 @@ static void *efi_read_file(const char *file, size_t *size)
static void efi_free_file(void *_mem, size_t size)
{
- efi_physical_addr_t mem = (efi_physical_addr_t)_mem;
+ efi_physical_addr_t mem = efi_virt_to_phys(_mem);
if (mem_malloc_start() <= mem && mem < mem_malloc_end())
free(_mem);
--
2.39.5
More information about the barebox
mailing list