From edad24c61e0b0a8a68d5feee735161ffd1863297 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 2 Jun 2021 15:41:39 +0900 Subject: [PATCH] efi: add const qualifier to EFI variable handling functions --- src/boot/efi/util.c | 8 ++++---- src/boot/efi/util.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/boot/efi/util.c b/src/boot/efi/util.c index c6aa7954bc1..6f4e5933d30 100644 --- a/src/boot/efi/util.c +++ b/src/boot/efi/util.c @@ -84,14 +84,14 @@ EFI_STATUS efivar_set(const EFI_GUID *vendor, const CHAR16 *name, const CHAR16 * return efivar_set_raw(vendor, name, value, value ? (StrLen(value) + 1) * sizeof(CHAR16) : 0, flags); } -EFI_STATUS efivar_set_uint_string(const EFI_GUID *vendor, CHAR16 *name, UINTN i, UINT32 flags) { +EFI_STATUS efivar_set_uint_string(const EFI_GUID *vendor, const CHAR16 *name, UINTN i, UINT32 flags) { CHAR16 str[32]; SPrint(str, 32, L"%u", i); return efivar_set(vendor, name, str, flags); } -EFI_STATUS efivar_set_uint32_le(const EFI_GUID *vendor, CHAR16 *name, UINT32 value, UINT32 flags) { +EFI_STATUS efivar_set_uint32_le(const EFI_GUID *vendor, const CHAR16 *name, UINT32 value, UINT32 flags) { UINT8 buf[4]; buf[0] = (UINT8)(value >> 0U & 0xFF); @@ -102,7 +102,7 @@ EFI_STATUS efivar_set_uint32_le(const EFI_GUID *vendor, CHAR16 *name, UINT32 val return efivar_set_raw(vendor, name, buf, sizeof(buf), flags); } -EFI_STATUS efivar_set_uint64_le(const EFI_GUID *vendor, CHAR16 *name, UINT64 value, UINT32 flags) { +EFI_STATUS efivar_set_uint64_le(const EFI_GUID *vendor, const CHAR16 *name, UINT64 value, UINT32 flags) { UINT8 buf[8]; buf[0] = (UINT8)(value >> 0U & 0xFF); @@ -233,7 +233,7 @@ EFI_STATUS efivar_get_boolean_u8(const EFI_GUID *vendor, const CHAR16 *name, BOO return err; } -VOID efivar_set_time_usec(const EFI_GUID *vendor, CHAR16 *name, UINT64 usec) { +VOID efivar_set_time_usec(const EFI_GUID *vendor, const CHAR16 *name, UINT64 usec) { CHAR16 str[32]; if (usec == 0) diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h index fc7377c0f77..1a42b010334 100644 --- a/src/boot/efi/util.h +++ b/src/boot/efi/util.h @@ -20,10 +20,10 @@ UINT64 time_usec(void); EFI_STATUS efivar_set(const EFI_GUID *vendor, const CHAR16 *name, const CHAR16 *value, UINT32 flags); EFI_STATUS efivar_set_raw(const EFI_GUID *vendor, const CHAR16 *name, const VOID *buf, UINTN size, UINT32 flags); -EFI_STATUS efivar_set_uint_string(const EFI_GUID *vendor, CHAR16 *name, UINTN i, UINT32 flags); -EFI_STATUS efivar_set_uint32_le(const EFI_GUID *vendor, CHAR16 *NAME, UINT32 value, UINT32 flags); -EFI_STATUS efivar_set_uint64_le(const EFI_GUID *vendor, CHAR16 *name, UINT64 value, UINT32 flags); -VOID efivar_set_time_usec(const EFI_GUID *vendor, CHAR16 *name, UINT64 usec); +EFI_STATUS efivar_set_uint_string(const EFI_GUID *vendor, const CHAR16 *name, UINTN i, UINT32 flags); +EFI_STATUS efivar_set_uint32_le(const EFI_GUID *vendor, const CHAR16 *NAME, UINT32 value, UINT32 flags); +EFI_STATUS efivar_set_uint64_le(const EFI_GUID *vendor, const CHAR16 *name, UINT64 value, UINT32 flags); +VOID efivar_set_time_usec(const EFI_GUID *vendor, const CHAR16 *name, UINT64 usec); EFI_STATUS efivar_get(const EFI_GUID *vendor, const CHAR16 *name, CHAR16 **value); EFI_STATUS efivar_get_raw(const EFI_GUID *vendor, const CHAR16 *name, CHAR8 **buffer, UINTN *size);