]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
boot: Rename remaining EFI_STATUS vars to err for consistency
authorJan Janssen <medhefgo@web.de>
Fri, 24 Jun 2022 08:49:19 +0000 (10:49 +0200)
committerJan Janssen <medhefgo@web.de>
Mon, 27 Jun 2022 10:16:27 +0000 (12:16 +0200)
src/boot/efi/measure.c
src/boot/efi/shim.c

index def42fece4f179de5298a57a91c28d51cae6510a..c31ab5e679e9b23116b37805d61ba09f7866b0e2 100644 (file)
@@ -82,21 +82,21 @@ static EFI_TCG *tcg1_interface_check(void) {
         TCG_BOOT_SERVICE_CAPABILITY capability = {
                 .Size = sizeof(capability),
         };
-        EFI_STATUS status;
+        EFI_STATUS err;
         UINT32 features;
         EFI_TCG *tcg;
 
-        status = BS->LocateProtocol((EFI_GUID *) EFI_TCG_GUID, NULL, (void **) &tcg);
-        if (EFI_ERROR(status))
+        err = BS->LocateProtocol((EFI_GUID *) EFI_TCG_GUID, NULL, (void **) &tcg);
+        if (EFI_ERROR(err))
                 return NULL;
 
-        status = tcg->StatusCheck(
+        err = tcg->StatusCheck(
                         tcg,
                         &capability,
                         &features,
                         &event_log_location,
                         &event_log_last_entry);
-        if (EFI_ERROR(status))
+        if (EFI_ERROR(err))
                 return NULL;
 
         if (capability.TPMDeactivatedFlag)
@@ -112,15 +112,15 @@ static EFI_TCG2 * tcg2_interface_check(void) {
         EFI_TCG2_BOOT_SERVICE_CAPABILITY capability = {
                 .Size = sizeof(capability),
         };
-        EFI_STATUS status;
+        EFI_STATUS err;
         EFI_TCG2 *tcg;
 
-        status = BS->LocateProtocol((EFI_GUID *) EFI_TCG2_GUID, NULL, (void **) &tcg);
-        if (EFI_ERROR(status))
+        err = BS->LocateProtocol((EFI_GUID *) EFI_TCG2_GUID, NULL, (void **) &tcg);
+        if (EFI_ERROR(err))
                 return NULL;
 
-        status = tcg->GetCapability(tcg, &capability);
-        if (EFI_ERROR(status))
+        err = tcg->GetCapability(tcg, &capability);
+        if (EFI_ERROR(err))
                 return NULL;
 
         if (capability.StructureVersion.Major == 1 &&
index 20db89817a88e7e1c51dcb8ea076e0c5faee9fbe..5a6a8bc5b64a7a82d10f735037e7e49cd2c670ba 100644 (file)
@@ -72,22 +72,22 @@ static EFI_SECURITY2_FILE_AUTHENTICATION es2fa = NULL;
 static EFIAPI EFI_STATUS security2_policy_authentication (const EFI_SECURITY2_PROTOCOL *this,
                                                           const EFI_DEVICE_PATH_PROTOCOL *device_path,
                                                           void *file_buffer, UINTN file_size, BOOLEAN boot_policy) {
-        EFI_STATUS status;
+        EFI_STATUS err;
 
         assert(this);
         /* device_path and file_buffer may be NULL */
 
         /* Chain original security policy */
-        status = es2fa(this, device_path, file_buffer, file_size, boot_policy);
+        err = es2fa(this, device_path, file_buffer, file_size, boot_policy);
 
         /* if OK, don't bother with MOK check */
-        if (!EFI_ERROR(status))
-                return status;
+        if (!EFI_ERROR(err))
+                return err;
 
         if (shim_validate(file_buffer, file_size))
                 return EFI_SUCCESS;
 
-        return status;
+        return err;
 }
 
 /*
@@ -101,7 +101,7 @@ static EFIAPI EFI_STATUS security2_policy_authentication (const EFI_SECURITY2_PR
  */
 static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROTOCOL *this, UINT32 authentication_status,
                                                          const EFI_DEVICE_PATH_PROTOCOL *device_path_const) {
-        EFI_STATUS status;
+        EFI_STATUS err;
         _cleanup_freepool_ CHAR16 *dev_path_str = NULL;
         EFI_HANDLE h;
         _cleanup_freepool_ CHAR8 *file_buffer = NULL;
@@ -113,22 +113,22 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT
                 return EFI_INVALID_PARAMETER;
 
         EFI_DEVICE_PATH *dp = (EFI_DEVICE_PATH *) device_path_const;
-        status = BS->LocateDevicePath(&FileSystemProtocol, &dp, &h);
-        if (EFI_ERROR(status))
-                return status;
+        err = BS->LocateDevicePath(&FileSystemProtocol, &dp, &h);
+        if (EFI_ERROR(err))
+                return err;
 
         _cleanup_(file_closep) EFI_FILE *root = NULL;
-        status = open_volume(h, &root);
-        if (status != EFI_SUCCESS)
-                return status;
+        err = open_volume(h, &root);
+        if (err != EFI_SUCCESS)
+                return err;
 
         dev_path_str = DevicePathToStr(dp);
         if (!dev_path_str)
                 return EFI_OUT_OF_RESOURCES;
 
-        status = file_read(root, dev_path_str, 0, 0, &file_buffer, &file_size);
-        if (EFI_ERROR(status))
-                return status;
+        err = file_read(root, dev_path_str, 0, 0, &file_buffer, &file_size);
+        if (EFI_ERROR(err))
+                return err;
 
         if (shim_validate(file_buffer, file_size))
                 return EFI_SUCCESS;
@@ -140,7 +140,7 @@ static EFIAPI EFI_STATUS security_policy_authentication (const EFI_SECURITY_PROT
 EFI_STATUS security_policy_install(void) {
         EFI_SECURITY_PROTOCOL *security_protocol;
         EFI_SECURITY2_PROTOCOL *security2_protocol = NULL;
-        EFI_STATUS status;
+        EFI_STATUS err;
 
         /* Already Installed */
         if (esfas)
@@ -153,10 +153,10 @@ EFI_STATUS security_policy_install(void) {
          */
         BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL2_GUID, NULL, (void**) &security2_protocol);
 
-        status = BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL_GUID, NULL, (void**) &security_protocol);
+        err = BS->LocateProtocol((EFI_GUID*) SECURITY_PROTOCOL_GUID, NULL, (void**) &security_protocol);
          /* This one is mandatory, so there's a serious problem */
-        if (EFI_ERROR(status))
-                return status;
+        if (EFI_ERROR(err))
+                return err;
 
         esfas = security_protocol->FileAuthenticationState;
         security_protocol->FileAuthenticationState = security_policy_authentication;