From patchwork Fri Jan 11 20:26:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1023766 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43bvYn4LjPz9sDL for ; Sat, 12 Jan 2019 07:27:37 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 66F20C22237; Fri, 11 Jan 2019 20:27:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 79F66C221B9; Fri, 11 Jan 2019 20:27:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D75C0C221B9; Fri, 11 Jan 2019 20:27:28 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lists.denx.de (Postfix) with ESMTPS id 85C57C22176 for ; Fri, 11 Jan 2019 20:27:28 +0000 (UTC) Received: from workstation4.fritz.box ([84.118.159.3]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MV30j-1glUqu0YjF-00YNM8; Fri, 11 Jan 2019 21:27:25 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Fri, 11 Jan 2019 21:26:58 +0100 Message-Id: <20190111202658.8852-1-xypron.glpk@gmx.de> X-Mailer: git-send-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ldLUuyEy4KKfLuRU5wz9FLCVeLXR2j0nTHH2Z9tm/XsctFS+LULUki nCWGZGVDcxuK31uGW79t7hJgGyRWleKNZYlxNtTlgdkBvCrT0AbIhzSffMJqxrRKUsW/aj0LU P2YoTktrc4322jjKOVZzUokKa8f/uwP2ZOBXQjUvYhttT9VFjBaAeEhOxd6jat Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Tom Rini Subject: [U-Boot] [PATCH 1/1] efi_loader: use u16* for file name X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" UTF-16 strings in our code should all be u16 *. Fix an inconsistency for file names which may lead to a warning for printf("%ls", ). Simon Glass Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- include/efi_api.h | 2 +- lib/efi_loader/efi_file.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 9b6b97457b..3b67920117 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1151,7 +1151,7 @@ struct efi_file_handle { u64 rev; efi_status_t (EFIAPI *open)(struct efi_file_handle *file, struct efi_file_handle **new_handle, - s16 *file_name, u64 open_mode, u64 attributes); + u16 *file_name, u64 open_mode, u64 attributes); efi_status_t (EFIAPI *close)(struct efi_file_handle *file); efi_status_t (EFIAPI *delete)(struct efi_file_handle *file); efi_status_t (EFIAPI *read)(struct efi_file_handle *file, diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 128cb0a627..dfa61bc2bc 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -148,7 +148,7 @@ static int sanitize_path(char *path) * Returns: handle to the opened file or NULL */ static struct efi_file_handle *file_open(struct file_system *fs, - struct file_handle *parent, s16 *file_name, u64 mode, + struct file_handle *parent, u16 *file_name, u64 mode, u64 attributes) { struct file_handle *fh; @@ -157,8 +157,8 @@ static struct efi_file_handle *file_open(struct file_system *fs, int flen = 0; if (file_name) { - utf16_to_utf8((u8 *)f0, (u16 *)file_name, 1); - flen = u16_strlen((u16 *)file_name); + utf16_to_utf8((u8 *)f0, file_name, 1); + flen = u16_strlen(file_name); } /* we could have a parent, but also an absolute path: */ @@ -183,7 +183,7 @@ static struct efi_file_handle *file_open(struct file_system *fs, *p++ = '/'; } - utf16_to_utf8((u8 *)p, (u16 *)file_name, flen); + utf16_to_utf8((u8 *)p, file_name, flen); if (sanitize_path(fh->path)) goto error; @@ -216,7 +216,7 @@ error: static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file, struct efi_file_handle **new_handle, - s16 *file_name, u64 open_mode, u64 attributes) + u16 *file_name, u64 open_mode, u64 attributes) { struct file_handle *fh = to_fh(file); efi_status_t ret; @@ -375,7 +375,7 @@ static efi_status_t dir_read(struct file_handle *fh, u64 *buffer_size, if (dent->type == FS_DT_DIR) info->attribute |= EFI_FILE_DIRECTORY; - ascii2unicode((u16 *)info->file_name, dent->name); + ascii2unicode(info->file_name, dent->name); fh->offset++; @@ -666,7 +666,7 @@ struct efi_file_handle *efi_file_from_path(struct efi_device_path *fp) return NULL; } - EFI_CALL(ret = f->open(f, &f2, (s16 *)fdp->str, + EFI_CALL(ret = f->open(f, &f2, fdp->str, EFI_FILE_MODE_READ, 0)); if (ret != EFI_SUCCESS) return NULL;