[U-Boot] [PATCH v2 1/1] efi_loader: efi_add_runtime_mmio()

The first parameter of efi_add_runtime_mmio() is a pointer to a pointer. This should be reflected both in the signature and in the documentation.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de --- v2 Correct the commit message and title. This patch changes efi_add_runtime_mmio(). --- include/efi_loader.h | 2 +- lib/efi_loader/efi_runtime.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/efi_loader.h b/include/efi_loader.h index 53f08161ab..0581c0940d 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -483,7 +483,7 @@ void __efi_runtime efi_update_table_header_crc32(struct efi_table_hdr *table);
/* Call this with mmio_ptr as the _pointer_ to a pointer to an MMIO region * to make it available at runtime */ -efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len); +efi_status_t efi_add_runtime_mmio(void **mmio_ptr, u64 len);
/* Boards may provide the functions below to implement RTS functionality */
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 95844efdb0..377a4fe602 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -502,11 +502,12 @@ static efi_status_t EFIAPI efi_set_virtual_address_map( * This function adds a memory-mapped IO region to the memory map to make it * available at runtime. * - * @mmio_ptr: address of the memory-mapped IO region + * @mmio_ptr: pointer to a pointer to the start of the memory-mapped + * IO region * @len: size of the memory-mapped IO region * Returns: status code */ -efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len) +efi_status_t efi_add_runtime_mmio(void **mmio_ptr, u64 len) { struct efi_runtime_mmio_list *newmmio; u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;

On 12/19/18 10:42 PM, Heinrich Schuchardt wrote:
The first parameter of efi_add_runtime_mmio() is a pointer to a pointer. This should be reflected both in the signature and in the documentation.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
v2 Correct the commit message and title. This patch changes efi_add_runtime_mmio().
There are build warnings leading to Travis failure with this patch.

On 23.12.18 00:55, Heinrich Schuchardt wrote:
On 12/19/18 10:42 PM, Heinrich Schuchardt wrote:
The first parameter of efi_add_runtime_mmio() is a pointer to a pointer. This should be reflected both in the signature and in the documentation.
Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de
v2 Correct the commit message and title. This patch changes efi_add_runtime_mmio().
There are build warnings leading to Travis failure with this patch.
Yes, void ** is a very particular type. If you want to say "something you really can't statically determine" - which this is - then you have to keep it as "void *".
Alex
participants (2)
-
Alexander Graf
-
Heinrich Schuchardt