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 <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Simon Glass
2022-01-23 12:55:12 -07:00
committed by Tom Rini
parent 587254ebcf
commit 156ccbc3c4
34 changed files with 267 additions and 267 deletions

View File

@@ -240,7 +240,7 @@ static int do_efi_capsule_res(struct cmd_tbl *cmdtp, int flag,
guid = efi_guid_capsule_report;
if (argc == 1) {
size = sizeof(var_name16);
ret = efi_get_variable_int(L"CapsuleLast", &guid, NULL,
ret = efi_get_variable_int(u"CapsuleLast", &guid, NULL,
&size, var_name16, NULL);
if (ret != EFI_SUCCESS) {
@@ -1120,7 +1120,7 @@ static int do_efi_boot_dump(struct cmd_tbl *cmdtp, int flag,
return CMD_RET_FAILURE;
}
if (memcmp(var_name16, L"Boot", 8))
if (memcmp(var_name16, u"Boot", 8))
continue;
for (id = 0, i = 0; i < 4; i++) {
@@ -1156,7 +1156,7 @@ static int show_efi_boot_order(void)
efi_status_t ret;
size = 0;
ret = EFI_CALL(efi_get_variable(L"BootOrder", &efi_global_variable_guid,
ret = EFI_CALL(efi_get_variable(u"BootOrder", &efi_global_variable_guid,
NULL, &size, NULL));
if (ret != EFI_BUFFER_TOO_SMALL) {
if (ret == EFI_NOT_FOUND) {
@@ -1171,7 +1171,7 @@ static int show_efi_boot_order(void)
printf("ERROR: Out of memory\n");
return CMD_RET_FAILURE;
}
ret = EFI_CALL(efi_get_variable(L"BootOrder", &efi_global_variable_guid,
ret = EFI_CALL(efi_get_variable(u"BootOrder", &efi_global_variable_guid,
NULL, &size, bootorder));
if (ret != EFI_SUCCESS) {
ret = CMD_RET_FAILURE;
@@ -1260,11 +1260,11 @@ static int do_efi_boot_next(struct cmd_tbl *cmdtp, int flag,
guid = efi_global_variable_guid;
size = sizeof(u16);
ret = efi_set_variable_int(L"BootNext", &guid,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
size, &bootnext, false);
ret = efi_set_variable_int(u"BootNext", &guid,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
size, &bootnext, false);
if (ret != EFI_SUCCESS) {
printf("Cannot set BootNext\n");
r = CMD_RET_FAILURE;
@@ -1321,11 +1321,11 @@ static int do_efi_boot_order(struct cmd_tbl *cmdtp, int flag,
}
guid = efi_global_variable_guid;
ret = efi_set_variable_int(L"BootOrder", &guid,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
size, bootorder, true);
ret = efi_set_variable_int(u"BootOrder", &guid,
EFI_VARIABLE_NON_VOLATILE |
EFI_VARIABLE_BOOTSERVICE_ACCESS |
EFI_VARIABLE_RUNTIME_ACCESS,
size, bootorder, true);
if (ret != EFI_SUCCESS) {
printf("Cannot set BootOrder\n");
r = CMD_RET_FAILURE;