From 4db17a4b12524d0ec2dc30913dbbf44f968ce8e0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Fri, 10 Feb 2023 08:13:23 +0100 Subject: [PATCH] efi_loader: fix struct efi_input_key MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The UEFI specification defines filed UnicodeChar as CHAR16. We use u16 for CHAR16 throughout our code. The change fixes the following errors: lib/efi_loader/initrddump.c: In function ‘efi_input’: lib/efi_loader/initrddump.c:218:38: warning: comparison is always false due to limited range of data type [-Wtype-limits] 218 | if (key.unicode_char >= 0xD800 && key.unicode_char <= 0xDBFF) | ^~ lib/efi_loader/initrddump.c:218:68: warning: comparison is always true due to limited range of data type [-Wtype-limits] 218 | if (key.unicode_char >= 0xD800 && key.unicode_char <= 0xDBFF) | ^~ Fixes: 867a6ac86dd8 ("efi: Add start-up library code") Reported-by: Marek Vasut Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/efi_api.h b/include/efi_api.h index 9bd70b0f18..e1cdaf5247 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -817,7 +817,7 @@ struct efi_simple_text_output_protocol { struct efi_input_key { u16 scan_code; - s16 unicode_char; + u16 unicode_char; }; #define EFI_SHIFT_STATE_INVALID 0x00000000 -- 2.39.5