]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: correct signature of CalculateCrc32()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 7 Jul 2018 13:36:04 +0000 (15:36 +0200)
committerAlexander Graf <agraf@suse.de>
Wed, 25 Jul 2018 13:00:24 +0000 (15:00 +0200)
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@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_api.h
lib/efi_loader/efi_boottime.c

index c98cc34908b6e2afde89e0c374c7aaae8efc17a8..ebf2a3bc18c86685ffde683941af56ac0d6f7409 100644 (file)
@@ -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);
index c0354258b95c4b70639b7b2a5a0eaedcf70fc9ba..820d766b410712ffe5cdda72b20c788ba2419d03 100644 (file)
@@ -2448,11 +2448,11 @@ static efi_status_t EFIAPI efi_uninstall_multiple_protocol_interfaces(
  *
  * Return: 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);
+       EFI_ENTRY("%p, %zu", data, data_size);
        *crc32_p = crc32(0, data, data_size);
        return EFI_EXIT(EFI_SUCCESS);
 }