efi_loader: use u16* for UTF16 strings
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 5 Nov 2018 19:22:12 +0000 (20:22 +0100)
committerAlexander Graf <agraf@suse.de>
Sun, 2 Dec 2018 20:59:37 +0000 (21:59 +0100)
We should be consistent in the types that we use to store Unicode strings.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
include/efi_api.h
lib/efi_loader/efi_file.c

index e58dd0581c99d300469384935cd3f652b2a63dd4..aef77b6319de5a68073f4bc16b8e6efdb3de34d8 100644 (file)
@@ -965,7 +965,7 @@ struct efi_file_info {
        struct efi_time last_access_time;
        struct efi_time modification_time;
        u64 attribute;
-       s16 file_name[0];
+       u16 file_name[0];
 };
 
 struct efi_file_system_info {
index beb4fba917d89fc6da8f47065152d41e6d6bf169..128cb0a6273a688e0359845826741a2024e7ada5 100644 (file)
@@ -563,7 +563,7 @@ static efi_status_t EFIAPI efi_file_getinfo(struct efi_file_handle *file,
                if (fh->isdir)
                        info->attribute |= EFI_FILE_DIRECTORY;
 
-               ascii2unicode((u16 *)info->file_name, filename);
+               ascii2unicode(info->file_name, filename);
        } else if (!guidcmp(info_type, &efi_file_system_info_guid)) {
                struct efi_file_system_info *info = buffer;
                disk_partition_t part;