From 146f9d8e8d75eff8d3277a5416943877ed902c73 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Wed, 17 Feb 2021 19:50:16 -0500 Subject: [PATCH] shim: use an enum for efi_main's error messages. Numbering the error messages in efi_main directly was a mistake, and the following patches just make it more apparent. This makes it an enum so we don't have to re-number at more than one place when we add or remove them. Signed-off-by: Peter Jones --- shim.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shim.c b/shim.c index f9af1d8..57b86b1 100644 --- a/shim.c +++ b/shim.c @@ -1855,7 +1855,10 @@ efi_main (EFI_HANDLE passed_image_handle, EFI_SYSTEM_TABLE *passed_systab) L"shim_init() failed", NULL }; - int msg = 0; + enum { + IMPORT_MOK_STATE, + SHIM_INIT, + } msg = IMPORT_MOK_STATE; /* * Set up the shim lock protocol so that grub and MokManager can @@ -1911,7 +1914,7 @@ die: efi_status = shim_init(); if (EFI_ERROR(efi_status)) { - msg = 1; + msg = SHIM_INIT; goto die; }