From 156ccbc3c4581a1e6d29c51f4af4e120e30a2ef0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 23 Jan 2022 12:55:12 -0700 Subject: efi: Use 16-bit unicode strings At present we use wide characters for unicode but this is not necessary. Change the code to use the 'u' literal instead. This helps to fix build warnings for sandbox on rpi. Signed-off-by: Simon Glass Suggested-by: Heinrich Schuchardt Reviewed-by: Heinrich Schuchardt --- lib/efi_loader/efi_bootmgr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/efi_loader/efi_bootmgr.c') diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 1fe19237f9a..8c04ecbdc83 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -46,8 +46,8 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle, void **load_options) { struct efi_load_option lo; - u16 varname[] = L"Boot0000"; - u16 hexmap[] = L"0123456789ABCDEF"; + u16 varname[] = u"Boot0000"; + u16 hexmap[] = u"0123456789ABCDEF"; void *load_option; efi_uintn_t size; efi_status_t ret; @@ -83,7 +83,7 @@ static efi_status_t try_load_entry(u16 n, efi_handle_t *handle, attributes = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS; - ret = efi_set_variable_int(L"BootCurrent", + ret = efi_set_variable_int(u"BootCurrent", &efi_global_variable_guid, attributes, sizeof(n), &n, false); if (ret != EFI_SUCCESS) @@ -149,7 +149,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options) /* BootNext */ size = sizeof(bootnext); - ret = efi_get_variable_int(L"BootNext", + ret = efi_get_variable_int(u"BootNext", &efi_global_variable_guid, NULL, &size, &bootnext, NULL); if (ret == EFI_SUCCESS || ret == EFI_BUFFER_TOO_SMALL) { @@ -158,7 +158,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options) log_err("BootNext must be 16-bit integer\n"); /* delete BootNext */ - ret = efi_set_variable_int(L"BootNext", + ret = efi_set_variable_int(u"BootNext", &efi_global_variable_guid, 0, 0, NULL, false); @@ -178,7 +178,7 @@ efi_status_t efi_bootmgr_load(efi_handle_t *handle, void **load_options) } /* BootOrder */ - bootorder = efi_get_var(L"BootOrder", &efi_global_variable_guid, &size); + bootorder = efi_get_var(u"BootOrder", &efi_global_variable_guid, &size); if (!bootorder) { log_info("BootOrder not defined\n"); ret = EFI_NOT_FOUND; -- cgit v1.2.3