From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qEEDs-0006Hn-E6 for mharc-grub-devel@gnu.org; Tue, 27 Jun 2023 15:19:32 -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 1qEEDq-0006He-3p for grub-devel@gnu.org; Tue, 27 Jun 2023 15:19:30 -0400 Received: from mail-ot1-x335.google.com ([2607:f8b0:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEEDn-0003fz-Q7 for grub-devel@gnu.org; Tue, 27 Jun 2023 15:19:29 -0400 Received: by mail-ot1-x335.google.com with SMTP id 46e09a7af769-6b5d6a05b6dso3935236a34.0 for ; Tue, 27 Jun 2023 12:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20221208.gappssmtp.com; s=20221208; t=1687893549; x=1690485549; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=N0tGFvP37jfTpniIepsgMcbdgXgF4dJxnxUswyrqCFg=; b=hfdpTL0xfdX2d7TMuAkV/fvRZ0fIMHG2kewvCmUqNwTzjRKAdD2FdIcazlMEHooyAg 7ePk/Onm7vKHQsuthwfSVxChsFOvcwY8LSNfxGOkCUDp35T6KwVW1INcXBl4RAw5iT0R /zJKbAI8fuDlnzhnoi3OrPQS3pY5L79FjSYey0YK41TLKK8+Af7jS0bV7wHAHSYiIJ8f M1eHN6Hq0oIM9AVu487I/bGB5VshMN0u8KjrpgiDVZx3JaI0BImozlBPAqajGid1WIsH NDByV8Atj2xqF+SOeBTXHkhhCAsAHc432eFbpd9uAA/s/uKIaxQULSco282sgXtss3eH aW1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687893549; x=1690485549; 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=N0tGFvP37jfTpniIepsgMcbdgXgF4dJxnxUswyrqCFg=; b=XSbSj6I32fBMj7uCoZ6kJZTliD4ejf9LYaLMnaXnCYqWgnk6M0u+5Hmqb0mFrXxpW5 1IqxaIwhTzDkehfV2FWQ7hZfDDR41cXNofB3/SalsOurPoYbyDFnkVUdPSeEqR+VtMMV lvW8R5qj0nGWwJQaiqGrCozEUzlwXlbfn8NFygkTA/Yxj/O8NrCqThm1Zcb1/C92+o9P m/Tc5Vv02zl+riK8XClLBxJwMiXwNPjrqNXOy7vTUTUpmMkvPyrxPNBGstDEw1VwdWlG aeOhLKcxVR0y5n9/cjLZC5mEC9Y+26IkRSBM02cQQ9t1Z8Dy5mUTgiBVRanAWT1FayC7 wwtQ== X-Gm-Message-State: AC+VfDzF6vaialxAD2GxSe2rLpMFAYTanBHYbL0U3IJKjxOxZjSI4wzK jeMdC6XDLXQ1F8ntzbGYcEb7zvtb0wZk/MuGmxdDdg== X-Google-Smtp-Source: ACHHUZ6dwWoESBL0CCjz7ipLpQt9BPedMoKYjYDKah4APaXyztC+EkZhWuwiPEux7WpiTXEHnDIX9w== X-Received: by 2002:a05:6870:3494:b0:1b0:67a9:3092 with SMTP id n20-20020a056870349400b001b067a93092mr1748313oah.42.1687893549387; Tue, 27 Jun 2023 12:19:09 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.249]) by smtp.gmail.com with ESMTPSA id bd6-20020a056870d78600b001ad21a705a8sm5450500oab.49.2023.06.27.12.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 12:19:08 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Ard Biesheuvel , Glenn Washburn Subject: [PATCH] efi: Print EFI status as hex number instead of uint Date: Tue, 27 Jun 2023 14:18:52 -0500 Message-Id: <20230627191852.17504-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::335; envelope-from=development@efficientek.com; helo=mail-ot1-x335.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: Tue, 27 Jun 2023 19:19:30 -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..ca6f60519d73 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 %" 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