summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-09-20 20:57:54 +0300
committerAlexander Graf <agraf@suse.de>2018-09-23 22:55:31 +0300
commit9d08f6db2a130a03282865ded550655b022e5ce7 (patch)
treebe02a5aad78eae897272d97671087a02f8972c84 /lib
parent4e6b5d6503ce8f16f00df4aedd137e919026dfad (diff)
downloadu-boot-9d08f6db2a130a03282865ded550655b022e5ce7.tar.xz
efi_loader: remove redundant statement
ascii2unicode() always ends the u16 string with '\0'. Remove redundant assignment. Add description for efi_str_to_u16() and ascii2unicode(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_device_path_to_text.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c
index ca8037def2..0082236359 100644
--- a/lib/efi_loader/efi_device_path_to_text.c
+++ b/lib/efi_loader/efi_device_path_to_text.c
@@ -17,6 +17,15 @@
const efi_guid_t efi_guid_device_path_to_text_protocol =
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID;
+/**
+ * efi_str_to_u16() - convert ASCII string to UTF-16
+ *
+ * A u16 buffer is allocated from pool. The ASCII string is copied to the u16
+ * buffer.
+ *
+ * @str: ASCII string
+ * Return: UTF-16 string. NULL if out of memory.
+ */
static u16 *efi_str_to_u16(char *str)
{
efi_uintn_t len;
@@ -29,7 +38,6 @@ static u16 *efi_str_to_u16(char *str)
if (ret != EFI_SUCCESS)
return NULL;
ascii2unicode(out, str);
- out[len - 1] = 0;
return out;
}