]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
EmulatorPkg: Apply uncrustify changes
[mirror_edk2.git] / EmulatorPkg / Library / RedfishPlatformCredentialLib / RedfishPlatformCredentialLib.c
index 5428aa324ec0068f630d6d5443c6b027dfe654e2..eaf9c56450e11127981d1aa21e476a71c6b2fefb 100644 (file)
 #include <Guid/GlobalVariable.h>\r
 #include <Guid/ImageAuthentication.h>\r
 \r
-BOOLEAN mSecureBootDisabled = FALSE;\r
-BOOLEAN mStopRedfishService = FALSE;\r
+BOOLEAN  mSecureBootDisabled = FALSE;\r
+BOOLEAN  mStopRedfishService = FALSE;\r
 \r
 EFI_STATUS\r
 EFIAPI\r
 LibStopRedfishService (\r
-  IN EDKII_REDFISH_CREDENTIAL_PROTOCOL          *This,\r
-  IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
-);\r
+  IN EDKII_REDFISH_CREDENTIAL_PROTOCOL           *This,\r
+  IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE  ServiceStopType\r
+  );\r
 \r
 /**\r
   Return the credential for accessing to Redfish servcice.\r
@@ -41,10 +41,10 @@ LibStopRedfishService (
 **/\r
 EFI_STATUS\r
 GetRedfishCredential (\r
-  OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,\r
-  OUT CHAR8 **UserId,\r
-  OUT CHAR8 **Password\r
-)\r
+  OUT EDKII_REDFISH_AUTH_METHOD  *AuthMethod,\r
+  OUT CHAR8                      **UserId,\r
+  OUT CHAR8                      **Password\r
+  )\r
 {\r
   UINTN  UserIdSize;\r
   UINTN  PasswordSize;\r
@@ -59,14 +59,16 @@ GetRedfishCredential (
   //\r
   UserIdSize   = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServieUserId));\r
   PasswordSize = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServiePassword));\r
-  if (UserIdSize == 0 || PasswordSize == 0) {\r
+  if ((UserIdSize == 0) || (PasswordSize == 0)) {\r
     DEBUG ((DEBUG_ERROR, "Incorrect string of UserID or Password for REdfish service.\n"));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
+\r
   *UserId = AllocateZeroPool (UserIdSize);\r
   if (*UserId == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
+\r
   CopyMem (*UserId, (CHAR8 *)PcdGetPtr (PcdRedfishServieUserId), UserIdSize);\r
 \r
   *Password = AllocateZeroPool (PasswordSize);\r
@@ -110,11 +112,11 @@ LibCredentialGetAuthInfo (
   OUT EDKII_REDFISH_AUTH_METHOD          *AuthMethod,\r
   OUT CHAR8                              **UserId,\r
   OUT CHAR8                              **Password\r
-)\r
+  )\r
 {\r
-  EFI_STATUS                   Status;\r
+  EFI_STATUS  Status;\r
 \r
-  if (This == NULL || AuthMethod == NULL || UserId == NULL || Password == NULL) {\r
+  if ((This == NULL) || (AuthMethod == NULL) || (UserId == NULL) || (Password == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
@@ -124,7 +126,7 @@ LibCredentialGetAuthInfo (
 \r
   if (mSecureBootDisabled) {\r
     Status = LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);\r
-    if (EFI_ERROR (Status) && Status != EFI_UNSUPPORTED) {\r
+    if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {\r
       DEBUG ((DEBUG_ERROR, "SecureBoot has been disabled, but failed to stop RedfishService - %r\n", Status));\r
       return Status;\r
     }\r
@@ -159,9 +161,9 @@ LibCredentialGetAuthInfo (
 EFI_STATUS\r
 EFIAPI\r
 LibStopRedfishService (\r
-  IN EDKII_REDFISH_CREDENTIAL_PROTOCOL    *This,\r
-  IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType\r
-)\r
+  IN EDKII_REDFISH_CREDENTIAL_PROTOCOL           *This,\r
+  IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE  ServiceStopType\r
+  )\r
 {\r
   if (ServiceStopType >= ServiceStopTypeMax) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -193,8 +195,10 @@ LibStopRedfishService (
     mStopRedfishService = TRUE;\r
     DEBUG ((DEBUG_INFO, "EFI Redfish service is stopped without Redfish service stop type!!\n"));\r
   }\r
+\r
   return EFI_SUCCESS;\r
 }\r
+\r
 /**\r
   Notification of Exit Boot Service.\r
 \r
@@ -204,7 +208,7 @@ VOID
 EFIAPI\r
 LibCredentialExitBootServicesNotify (\r
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This\r
-)\r
+  )\r
 {\r
   LibStopRedfishService (This, ServiceStopTypeExitBootService);\r
 }\r
@@ -218,15 +222,15 @@ VOID
 EFIAPI\r
 LibCredentialEndOfDxeNotify (\r
   IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This\r
-)\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
-  UINT8  *SecureBootVar;\r
+  UINT8       *SecureBootVar;\r
 \r
   //\r
   // Check Secure Boot status and lock Redfish service if Secure Boot is disabled.\r
   //\r
-  Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBootVar, NULL);\r
+  Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID **)&SecureBootVar, NULL);\r
   if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {\r
     //\r
     // Secure Boot is disabled\r