aboutsummaryrefslogtreecommitdiff
path: root/include/efi_variable.h
diff options
context:
space:
mode:
authorHeinrich Schuchardt2021-09-09 07:12:14 +0200
committerHeinrich Schuchardt2021-10-25 21:13:06 +0200
commitd47671c631c3f3f3bbf0a33f6bf8afeebfe8c091 (patch)
tree1539f8fbd8cda2d00ada509b904dd88b2324aa3e /include/efi_variable.h
parent7a6fb28c8e4b03bc37b05936ae5fa4c16c278520 (diff)
efi_loader: treat UEFI variable name as const
UEFI variable names are typically constants and hence should be defined as const. Unfortunately some of our API functions do not define the parameters for UEFI variable names as const. This requires unnecessary conversions. Adjust parameters of several internal functions to tre UEFI variable names as const. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/efi_variable.h')
-rw-r--r--include/efi_variable.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/efi_variable.h b/include/efi_variable.h
index 0440d356bc8..8f666b23096 100644
--- a/include/efi_variable.h
+++ b/include/efi_variable.h
@@ -32,7 +32,8 @@ enum efi_auth_var_type {
* @timep: authentication time (seconds since start of epoch)
* Return: status code
*/
-efi_status_t efi_get_variable_int(u16 *variable_name, const efi_guid_t *vendor,
+efi_status_t efi_get_variable_int(const u16 *variable_name,
+ const efi_guid_t *vendor,
u32 *attributes, efi_uintn_t *data_size,
void *data, u64 *timep);
@@ -47,7 +48,8 @@ efi_status_t efi_get_variable_int(u16 *variable_name, const efi_guid_t *vendor,
* @ro_check: check the read only read only bit in attributes
* Return: status code
*/
-efi_status_t efi_set_variable_int(u16 *variable_name, const efi_guid_t *vendor,
+efi_status_t efi_set_variable_int(const u16 *variable_name,
+ const efi_guid_t *vendor,
u32 attributes, efi_uintn_t data_size,
const void *data, bool ro_check);
@@ -224,7 +226,7 @@ void efi_var_mem_del(struct efi_var_entry *var);
* @time: time of authentication (as seconds since start of epoch)
* Result: status code
*/
-efi_status_t efi_var_mem_ins(u16 *variable_name,
+efi_status_t efi_var_mem_ins(const u16 *variable_name,
const efi_guid_t *vendor, u32 attributes,
const efi_uintn_t size1, const void *data1,
const efi_uintn_t size2, const void *data2,
@@ -251,7 +253,8 @@ efi_status_t efi_init_secure_state(void);
* @guid: guid of UEFI variable
* Return: identifier for authentication related variables
*/
-enum efi_auth_var_type efi_auth_var_get_type(u16 *name, const efi_guid_t *guid);
+enum efi_auth_var_type efi_auth_var_get_type(const u16 *name,
+ const efi_guid_t *guid);
/**
* efi_get_next_variable_name_mem() - Runtime common code across efi variable
@@ -280,8 +283,9 @@ efi_get_next_variable_name_mem(efi_uintn_t *variable_name_size, u16 *variable_na
* Return: status code
*/
efi_status_t __efi_runtime
-efi_get_variable_mem(u16 *variable_name, const efi_guid_t *vendor, u32 *attributes,
- efi_uintn_t *data_size, void *data, u64 *timep);
+efi_get_variable_mem(const u16 *variable_name, const efi_guid_t *vendor,
+ u32 *attributes, efi_uintn_t *data_size, void *data,
+ u64 *timep);
/**
* efi_get_variable_runtime() - runtime implementation of GetVariable()