[U-Boot] [PATCH 2/3] efi_loader: correct signature of CalculateCrc32()
Heinrich Schuchardt
xypron.glpk at gmx.de
Thu Jul 5 20:09:54 UTC 2018
Use const for the buffer. We are not changing the buffer.
Use efi_uintn_t where prescribed by the UEFI spec.
Prefer u32 over uint32_t.
Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
include/efi_api.h | 5 +++--
lib/efi_loader/efi_boottime.c | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/include/efi_api.h b/include/efi_api.h
index c98cc34908..ebf2a3bc18 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -165,8 +165,9 @@ struct efi_boot_services {
void **handle, ...);
efi_status_t (EFIAPI *uninstall_multiple_protocol_interfaces)(
void *handle, ...);
- efi_status_t (EFIAPI *calculate_crc32)(void *data,
- unsigned long data_size, uint32_t *crc32);
+ efi_status_t (EFIAPI *calculate_crc32)(const void *data,
+ efi_uintn_t data_size,
+ u32 *crc32);
void (EFIAPI *copy_mem)(void *destination, const void *source,
size_t length);
void (EFIAPI *set_mem)(void *buffer, size_t size, uint8_t value);
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 9ac8e18680..5a011f0b36 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2418,9 +2418,9 @@ static efi_status_t EFIAPI efi_uninstall_multiple_protocol_interfaces(
* @crc32_p: cyclic redundancy code
* Return Value: status code
*/
-static efi_status_t EFIAPI efi_calculate_crc32(void *data,
- unsigned long data_size,
- uint32_t *crc32_p)
+static efi_status_t EFIAPI efi_calculate_crc32(const void *data,
+ efi_uintn_t data_size,
+ u32 *crc32_p)
{
EFI_ENTRY("%p, %ld", data, data_size);
*crc32_p = crc32(0, data, data_size);
--
2.18.0
More information about the U-Boot
mailing list