From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qEOXK-0007RG-QA for mharc-grub-devel@gnu.org; Wed, 28 Jun 2023 02:20:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEOXB-0007Lh-GR for grub-devel@gnu.org; Wed, 28 Jun 2023 02:20:13 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEOX9-00057a-NE for grub-devel@gnu.org; Wed, 28 Jun 2023 02:20:09 -0400 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6b71ee710edso4724675a34.2 for ; Tue, 27 Jun 2023 23:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20221208.gappssmtp.com; s=20221208; t=1687933205; x=1690525205; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ncsPqPOjlJ9O7H0UkL41ZGui/CNtWu2xRWxF3uWGXZI=; b=iZ2xYm4Twvcu4T0qVO0OOF9qGSiYKfxoO9XLgKGkAmHcjW1EmnjI9FYdrWlYQgfeE3 evoeeIKziU2OylUcWoB9oyvPYgr0bzwDMHTE+fzd35N9VDD12XmKTWWh9KRSKfxFIVKp n21KH1zbf4Ct0Vkgvtmmv8587Ply96J3u8fbdF6d57cPA4WyyQ50T9ZZa0vK3NnAjte2 EgnXsICVgnfD8MHqU5EwSMiJSaw8kxBi3vyED+f1uDYiYdHvVS9MAaCMznwP3dVSji4m 6YrEji1bOx/YDiBsFEjNhWZjHaAlqdiu3lNlwGW9YANLIPE03nYlQSdanIAs+7+vTH3P Pd3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687933205; x=1690525205; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ncsPqPOjlJ9O7H0UkL41ZGui/CNtWu2xRWxF3uWGXZI=; b=HggjftGUfsojoj6bZdcs+b94EfKacntuTVP49/yvXyTt2LeGAZXa4FJnfBA8PA3m+w f+qN2E4U7mrJKbLKjQW3PJS/lxdeTZoX20r+YJlL1K2HRKpbMaO//fm4nRFNeetr2m+a giVIV/YGrXnRmq5z5Qd06LhFGVqCkdRMA7K9uAqEvZjUf9S1uVJDBxSZeGQfOVqcQuOz Dau0LyBXVM1o/WaPaHGgZLhZSAKQxNwyh+sAlll6GanBWILAIjVryVH/A+IygmZijEnE OS9L6JUeG/wEAgRFud1H7nTT2Qlxnh/WuF8bBrT+Bj874gyEdMBd7UyFTGq8yUxPeKf4 FIEw== X-Gm-Message-State: AC+VfDz+uE/3HQbgMjvaDXHOb3l4FjeZwMoqFflJNOfc96bwXzSaBvvK nyZ8sAEk+n1pjks6sEaPeCcVga+VttiLP1dX6UzxDg== X-Google-Smtp-Source: ACHHUZ7qlztOFpXqWg8ijl+xWAdFZKSTts1S013jAQ6aixV5I5EO+8Iahzy2ZqQ00j7V8zksyElQVg== X-Received: by 2002:a4a:e509:0:b0:558:a4cd:8813 with SMTP id r9-20020a4ae509000000b00558a4cd8813mr25099212oot.9.1687933205038; Tue, 27 Jun 2023 23:20:05 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.249]) by smtp.gmail.com with ESMTPSA id q6-20020a9d6646000000b006b871010cb1sm1075771otm.46.2023.06.27.23.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 23:20:04 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Ard Biesheuvel , Glenn Washburn Subject: [PATCH v2] efi: Print EFI status as hex number instead of uint Date: Wed, 28 Jun 2023 01:19:48 -0500 Message-Id: <20230628061948.416712-1-development@efficientek.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=development@efficientek.com; helo=mail-ot1-x332.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2023 06:20:14 -0000 EFI status codes are of different classes depending on the first byte and all error status codes defined in appendix D of the main spec start from 1 and have the high bit set. When printing as a uint, the decimal is a very large number that needs have the high bit cleared get the spec error code. This can be easily visually done by a human if the number is printed as hex. Signed-off-by: Glenn Washburn --- grub-core/loader/efi/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c index c1eef7c9865f..3a910b565007 100644 --- a/grub-core/loader/efi/linux.c +++ b/grub-core/loader/efi/linux.c @@ -234,7 +234,7 @@ grub_arch_efi_linux_boot_image (grub_addr_t addr, grub_size_t size, char *args) status = b->start_image (image_handle, 0, NULL); /* When successful, not reached */ - grub_error (GRUB_ERR_BAD_OS, "start_image() returned %" PRIuGRUB_EFI_UINTN_T, status); + grub_error (GRUB_ERR_BAD_OS, "start_image() returned 0x%" PRIxGRUB_EFI_UINTN_T, status); grub_efi_free_pages ((grub_addr_t) loaded_image->load_options, GRUB_EFI_BYTES_TO_PAGES (loaded_image->load_options_size)); unload: -- 2.34.1