]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: efi_set_variable use const void *
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 30 Dec 2018 20:03:15 +0000 (21:03 +0100)
committerAlexander Graf <agraf@suse.de>
Wed, 13 Feb 2019 08:40:05 +0000 (09:40 +0100)
The SetVariable() runtime service does not change the data passed to it.
So mark the parameter as constant.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_api.h
include/efi_loader.h
lib/efi_loader/efi_variable.c

index 83fd12b685d5fd25964530c008472b9872d05f50..1d3774729dea277e6b94e871bd2263ecb5a6e2e2 100644 (file)
@@ -230,7 +230,8 @@ struct efi_runtime_services {
        efi_status_t (EFIAPI *set_variable)(u16 *variable_name,
                                            const efi_guid_t *vendor,
                                            u32 attributes,
-                                           efi_uintn_t data_size, void *data);
+                                           efi_uintn_t data_size,
+                                           const void *data);
        efi_status_t (EFIAPI *get_next_high_mono_count)(
                        uint32_t *high_count);
        void (EFIAPI *reset_system)(enum efi_reset_type reset_type,
index 5420c99e0c31a419aa774a66d0a86be889615b04..b44678169aa68e5b3b069f4332c6d0704f6d9893 100644 (file)
@@ -518,7 +518,7 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
                                               const efi_guid_t *vendor);
 efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
                                     const efi_guid_t *vendor, u32 attributes,
-                                    efi_uintn_t data_size, void *data);
+                                    efi_uintn_t data_size, const void *data);
 
 /*
  * See section 3.1.3 in the v2.7 UEFI spec for more details on
index 4e6a04e614550b0b8d76d4766b29c0357243d99b..c302dbd2fe09ac9dfaac85629430947dfc6ae9b9 100644 (file)
@@ -254,7 +254,7 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
 /* http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES#SetVariable.28.29 */
 efi_status_t EFIAPI efi_set_variable(u16 *variable_name,
                                     const efi_guid_t *vendor, u32 attributes,
-                                    efi_uintn_t data_size, void *data)
+                                    efi_uintn_t data_size, const void *data)
 {
        char *native_name = NULL, *val = NULL, *s;
        efi_status_t ret = EFI_SUCCESS;