summaryrefslogtreecommitdiffstats
path: root/EmulatorPkg/Library/RedfishPlatformCredentialLib
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2021-12-05 14:53:57 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-07 17:24:28 +0000
commita550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97 (patch)
tree16ea0a059e01bb8af07f41dcea5996424c309a95 /EmulatorPkg/Library/RedfishPlatformCredentialLib
parente7108d0e9655b1795c94ac372b0449f28dd907df (diff)
downloadedk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.tar.gz
edk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.tar.bz2
edk2-a550d468a6ca577d9e9c57a0eafcf2fc9fbb8c97.zip
EmulatorPkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmulatorPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
Diffstat (limited to 'EmulatorPkg/Library/RedfishPlatformCredentialLib')
-rw-r--r--EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
index 5428aa324e..eaf9c56450 100644
--- a/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
+++ b/EmulatorPkg/Library/RedfishPlatformCredentialLib/RedfishPlatformCredentialLib.c
@@ -18,15 +18,15 @@
#include <Guid/GlobalVariable.h>
#include <Guid/ImageAuthentication.h>
-BOOLEAN mSecureBootDisabled = FALSE;
-BOOLEAN mStopRedfishService = FALSE;
+BOOLEAN mSecureBootDisabled = FALSE;
+BOOLEAN mStopRedfishService = FALSE;
EFI_STATUS
EFIAPI
LibStopRedfishService (
- IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
- IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
-);
+ IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
+ IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
+ );
/**
Return the credential for accessing to Redfish servcice.
@@ -41,10 +41,10 @@ LibStopRedfishService (
**/
EFI_STATUS
GetRedfishCredential (
- OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
- OUT CHAR8 **UserId,
- OUT CHAR8 **Password
-)
+ OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
+ OUT CHAR8 **UserId,
+ OUT CHAR8 **Password
+ )
{
UINTN UserIdSize;
UINTN PasswordSize;
@@ -59,14 +59,16 @@ GetRedfishCredential (
//
UserIdSize = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServieUserId));
PasswordSize = AsciiStrSize ((CHAR8 *)PcdGetPtr (PcdRedfishServiePassword));
- if (UserIdSize == 0 || PasswordSize == 0) {
+ if ((UserIdSize == 0) || (PasswordSize == 0)) {
DEBUG ((DEBUG_ERROR, "Incorrect string of UserID or Password for REdfish service.\n"));
return EFI_INVALID_PARAMETER;
}
+
*UserId = AllocateZeroPool (UserIdSize);
if (*UserId == NULL) {
return EFI_OUT_OF_RESOURCES;
}
+
CopyMem (*UserId, (CHAR8 *)PcdGetPtr (PcdRedfishServieUserId), UserIdSize);
*Password = AllocateZeroPool (PasswordSize);
@@ -110,11 +112,11 @@ LibCredentialGetAuthInfo (
OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
OUT CHAR8 **UserId,
OUT CHAR8 **Password
-)
+ )
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
- if (This == NULL || AuthMethod == NULL || UserId == NULL || Password == NULL) {
+ if ((This == NULL) || (AuthMethod == NULL) || (UserId == NULL) || (Password == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -124,7 +126,7 @@ LibCredentialGetAuthInfo (
if (mSecureBootDisabled) {
Status = LibStopRedfishService (This, ServiceStopTypeSecureBootDisabled);
- if (EFI_ERROR (Status) && Status != EFI_UNSUPPORTED) {
+ if (EFI_ERROR (Status) && (Status != EFI_UNSUPPORTED)) {
DEBUG ((DEBUG_ERROR, "SecureBoot has been disabled, but failed to stop RedfishService - %r\n", Status));
return Status;
}
@@ -159,9 +161,9 @@ LibCredentialGetAuthInfo (
EFI_STATUS
EFIAPI
LibStopRedfishService (
- IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
- IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
-)
+ IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This,
+ IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE ServiceStopType
+ )
{
if (ServiceStopType >= ServiceStopTypeMax) {
return EFI_INVALID_PARAMETER;
@@ -193,8 +195,10 @@ LibStopRedfishService (
mStopRedfishService = TRUE;
DEBUG ((DEBUG_INFO, "EFI Redfish service is stopped without Redfish service stop type!!\n"));
}
+
return EFI_SUCCESS;
}
+
/**
Notification of Exit Boot Service.
@@ -204,7 +208,7 @@ VOID
EFIAPI
LibCredentialExitBootServicesNotify (
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
-)
+ )
{
LibStopRedfishService (This, ServiceStopTypeExitBootService);
}
@@ -218,15 +222,15 @@ VOID
EFIAPI
LibCredentialEndOfDxeNotify (
IN EDKII_REDFISH_CREDENTIAL_PROTOCOL *This
-)
+ )
{
EFI_STATUS Status;
- UINT8 *SecureBootVar;
+ UINT8 *SecureBootVar;
//
// Check Secure Boot status and lock Redfish service if Secure Boot is disabled.
//
- Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBootVar, NULL);
+ Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID **)&SecureBootVar, NULL);
if (EFI_ERROR (Status) || (*SecureBootVar != SECURE_BOOT_MODE_ENABLE)) {
//
// Secure Boot is disabled