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 --- cmd/efidebug.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'cmd') diff --git a/cmd/efidebug.c b/cmd/efidebug.c index 66ce0fc3058..401d13cc4ca 100644 --- a/cmd/efidebug.c +++ b/cmd/efidebug.c @@ -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; -- cgit v1.2.3