nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

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

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