aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-05 16:35:52 +0200
committerAlexander Graf <agraf@suse.de>2017-10-09 07:00:29 +0200
commitfc05a9590689b70fffdb9914e9867ea53fd579fa (patch)
treebb597213405447724eacc8aa0f38cc705732823c /lib
parentf7c78176d6925726d654cd84eb866c7b39da1b13 (diff)
downloadu-boot-fc05a9590689b70fffdb9914e9867ea53fd579fa.zip
u-boot-fc05a9590689b70fffdb9914e9867ea53fd579fa.tar.gz
u-boot-fc05a9590689b70fffdb9914e9867ea53fd579fa.tar.bz2
efi_loader: parameters of CopyMem and SetMem
The UEFI spec defines the length parameters of CopyMem and SetMem as UINTN. We should size_t here. The source buffer of CopyMem should be marked as const. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index b8b98f2..c48ff2c 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1863,10 +1863,10 @@ static efi_status_t EFIAPI efi_calculate_crc32(void *data,
* @source source of the copy operation
* @length number of bytes to copy
*/
-static void EFIAPI efi_copy_mem(void *destination, void *source,
- unsigned long length)
+static void EFIAPI efi_copy_mem(void *destination, const void *source,
+ size_t length)
{
- EFI_ENTRY("%p, %p, %ld", destination, source, length);
+ EFI_ENTRY("%p, %p, %ld", destination, source, (unsigned long)length);
memcpy(destination, source, length);
EFI_EXIT(EFI_SUCCESS);
}
@@ -1882,9 +1882,9 @@ static void EFIAPI efi_copy_mem(void *destination, void *source,
* @size size of buffer in bytes
* @value byte to copy to the buffer
*/
-static void EFIAPI efi_set_mem(void *buffer, unsigned long size, uint8_t value)
+static void EFIAPI efi_set_mem(void *buffer, size_t size, uint8_t value)
{
- EFI_ENTRY("%p, %ld, 0x%x", buffer, size, value);
+ EFI_ENTRY("%p, %ld, 0x%x", buffer, (unsigned long)size, value);
memset(buffer, value, size);
EFI_EXIT(EFI_SUCCESS);
}