nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0276-commands-efi-tpm-Refine-the-status-of-log-event.patch

b35c50
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
b35c50
From: Lu Ken <ken.lu@intel.com>
b35c50
Date: Wed, 13 Jul 2022 10:06:10 +0800
b35c50
Subject: [PATCH] commands/efi/tpm: Refine the status of log event
b35c50
b35c50
1. Use macro GRUB_ERR_NONE instead of hard code 0.
b35c50
2. Keep lowercase of the first char for the status string of log event.
b35c50
b35c50
Signed-off-by: Lu Ken <ken.lu@intel.com>
b35c50
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
b35c50
(cherry picked from commit 922898573e37135f5dedc16f3e15a1d1d4c53f8a)
b35c50
---
b35c50
 grub-core/commands/efi/tpm.c | 10 +++++-----
b35c50
 1 file changed, 5 insertions(+), 5 deletions(-)
b35c50
b35c50
diff --git a/grub-core/commands/efi/tpm.c b/grub-core/commands/efi/tpm.c
b35c50
index a97d85368a..7acf510499 100644
b35c50
--- a/grub-core/commands/efi/tpm.c
b35c50
+++ b/grub-core/commands/efi/tpm.c
b35c50
@@ -135,17 +135,17 @@ grub_efi_log_event_status (grub_efi_status_t status)
b35c50
   switch (status)
b35c50
     {
b35c50
     case GRUB_EFI_SUCCESS:
b35c50
-      return 0;
b35c50
+      return GRUB_ERR_NONE;
b35c50
     case GRUB_EFI_DEVICE_ERROR:
b35c50
-      return grub_error (GRUB_ERR_IO, N_("Command failed"));
b35c50
+      return grub_error (GRUB_ERR_IO, N_("command failed"));
b35c50
     case GRUB_EFI_INVALID_PARAMETER:
b35c50
-      return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Invalid parameter"));
b35c50
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("invalid parameter"));
b35c50
     case GRUB_EFI_BUFFER_TOO_SMALL:
b35c50
-      return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("Output buffer too small"));
b35c50
+      return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("output buffer too small"));
b35c50
     case GRUB_EFI_NOT_FOUND:
b35c50
       return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("TPM unavailable"));
b35c50
     default:
b35c50
-      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("Unknown TPM error"));
b35c50
+      return grub_error (GRUB_ERR_UNKNOWN_DEVICE, N_("unknown TPM error"));
b35c50
     }
b35c50
 }
b35c50