RedfishPkg: Apply uncrustify changes

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the RedfishPkg 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: Abner Chang <abner.chang@hpe.com>
This commit is contained in:
Michael Kubacki
2021-12-05 14:54:11 -08:00
committed by mergify[bot]
parent 5220bd211d
commit 39de741e2d
56 changed files with 6067 additions and 4616 deletions

View File

@@ -10,7 +10,7 @@
#include "RedfishMisc.h"
EDKII_REDFISH_CREDENTIAL_PROTOCOL *mCredentialProtocol = NULL;
EDKII_REDFISH_CREDENTIAL_PROTOCOL *mCredentialProtocol = NULL;
/**
This function returns the string of Redfish service version.
@@ -23,25 +23,28 @@ EDKII_REDFISH_CREDENTIAL_PROTOCOL *mCredentialProtocol = NULL;
**/
EFI_STATUS
RedfishGetServiceVersion (
IN REDFISH_SERVICE RedfishService,
OUT CHAR8 **ServiceVersionStr
IN REDFISH_SERVICE RedfishService,
OUT CHAR8 **ServiceVersionStr
)
{
redfishService *Redfish;
CHAR8 **KeysArray;
UINTN KeysNum;
redfishService *Redfish;
CHAR8 **KeysArray;
UINTN KeysNum;
if (RedfishService == NULL || ServiceVersionStr == NULL) {
if ((RedfishService == NULL) || (ServiceVersionStr == NULL)) {
return EFI_INVALID_PARAMETER;
}
Redfish = (redfishService *)RedfishService;
if (Redfish->versions == NULL) {
return EFI_INVALID_PARAMETER;
}
KeysArray = JsonObjectGetKeys (Redfish->versions, &KeysNum);
if (KeysNum == 0 || KeysArray == NULL) {
if ((KeysNum == 0) || (KeysArray == NULL)) {
return EFI_NOT_FOUND;
}
*ServiceVersionStr = *KeysArray;
return EFI_SUCCESS;
}
@@ -65,18 +68,17 @@ RedfishGetServiceVersion (
**/
REDFISH_SERVICE
RedfishCreateLibredfishService (
IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo,
IN EDKII_REDFISH_AUTH_METHOD AuthMethod,
IN CHAR8 *UserId,
IN CHAR8 *Password
IN REDFISH_CONFIG_SERVICE_INFORMATION *RedfishConfigServiceInfo,
IN EDKII_REDFISH_AUTH_METHOD AuthMethod,
IN CHAR8 *UserId,
IN CHAR8 *Password
)
{
UINTN Flags;
enumeratorAuthentication Auth;
redfishService *Redfish;
UINTN Flags;
enumeratorAuthentication Auth;
redfishService* Redfish;
Redfish = NULL;
Redfish = NULL;
ZeroMem (&Auth, sizeof (Auth));
if (AuthMethod == AuthMethodHttpBasic) {
@@ -84,25 +86,26 @@ RedfishCreateLibredfishService (
} else if (AuthMethod == AuthMethodRedfishSession) {
Auth.authType = REDFISH_AUTH_SESSION;
}
Auth.authCodes.userPass.username = UserId;
Auth.authCodes.userPass.password = Password;
Flags = REDFISH_FLAG_SERVICE_NO_VERSION_DOC;
if (AuthMethod != AuthMethodNone) {
Redfish = createServiceEnumerator(RedfishConfigServiceInfo, NULL, &Auth, (unsigned int ) Flags);
Redfish = createServiceEnumerator (RedfishConfigServiceInfo, NULL, &Auth, (unsigned int)Flags);
} else {
Redfish = createServiceEnumerator(RedfishConfigServiceInfo, NULL, NULL, (unsigned int) Flags);
Redfish = createServiceEnumerator (RedfishConfigServiceInfo, NULL, NULL, (unsigned int)Flags);
}
//
// Zero the Password after use.
//
if (Password != NULL) {
ZeroMem (Password, AsciiStrLen(Password));
ZeroMem (Password, AsciiStrLen (Password));
}
return (REDFISH_SERVICE) Redfish;
return (REDFISH_SERVICE)Redfish;
}
/**
@@ -130,14 +133,14 @@ RedfishCreateLibredfishService (
**/
EFI_STATUS
RedfishGetAuthInfo (
OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
OUT CHAR8 **UserId,
OUT CHAR8 **Password
OUT EDKII_REDFISH_AUTH_METHOD *AuthMethod,
OUT CHAR8 **UserId,
OUT CHAR8 **Password
)
{
EFI_STATUS Status;
EFI_STATUS Status;
if (AuthMethod == NULL || UserId == NULL || Password == NULL) {
if ((AuthMethod == NULL) || (UserId == NULL) || (Password == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -161,6 +164,7 @@ RedfishGetAuthInfo (
return Status;
}
/**
This function returns the string of Redfish service version.
@@ -175,15 +179,15 @@ RedfishGetAuthInfo (
**/
EFI_STATUS
RedfishBuildRedpathUseId (
IN CHAR8 *ServiceVerisonStr,
IN CHAR8 *Url,
IN CHAR8 *Id,
OUT CHAR8 **Redpath
IN CHAR8 *ServiceVerisonStr,
IN CHAR8 *Url,
IN CHAR8 *Id,
OUT CHAR8 **Redpath
)
{
UINTN RedpathSize;
UINTN RedpathSize;
if (Redpath == NULL || ServiceVerisonStr == NULL || Url == NULL || Id == NULL) {
if ((Redpath == NULL) || (ServiceVerisonStr == NULL) || (Url == NULL) || (Id == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -192,10 +196,11 @@ RedfishBuildRedpathUseId (
AsciiStrLen (Url) +
AsciiStrLen ("[Id=]") +
AsciiStrLen (Id) + 1;
*Redpath = AllocatePool(RedpathSize);
*Redpath = AllocatePool (RedpathSize);
if (*Redpath == NULL) {
return EFI_OUT_OF_RESOURCES;
}
AsciiSPrint (*Redpath, RedpathSize, "/%a%a[Id=%a]", ServiceVerisonStr, Url, Id);
return EFI_SUCCESS;
}