MdeModulePkg: Apply uncrustify changes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the MdeModulePkg 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: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
committed by
mergify[bot]
parent
7c7184e201
commit
1436aea4d5
@@ -11,24 +11,24 @@
|
||||
//
|
||||
// ProtocolRequest - Last LocateHandle request ID
|
||||
//
|
||||
UINTN mEfiLocateHandleRequest = 0;
|
||||
UINTN mEfiLocateHandleRequest = 0;
|
||||
|
||||
//
|
||||
// Internal prototypes
|
||||
//
|
||||
|
||||
typedef struct {
|
||||
EFI_GUID *Protocol;
|
||||
VOID *SearchKey;
|
||||
LIST_ENTRY *Position;
|
||||
PROTOCOL_ENTRY *ProtEntry;
|
||||
EFI_GUID *Protocol;
|
||||
VOID *SearchKey;
|
||||
LIST_ENTRY *Position;
|
||||
PROTOCOL_ENTRY *ProtEntry;
|
||||
} LOCATE_POSITION;
|
||||
|
||||
typedef
|
||||
IHANDLE *
|
||||
(* CORE_GET_NEXT) (
|
||||
IN OUT LOCATE_POSITION *Position,
|
||||
OUT VOID **Interface
|
||||
(*CORE_GET_NEXT) (
|
||||
IN OUT LOCATE_POSITION *Position,
|
||||
OUT VOID **Interface
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ SmmGetNextLocateAllHandles (
|
||||
OUT VOID **Interface
|
||||
)
|
||||
{
|
||||
IHANDLE *Handle;
|
||||
IHANDLE *Handle;
|
||||
|
||||
//
|
||||
// Next handle
|
||||
@@ -58,11 +58,12 @@ SmmGetNextLocateAllHandles (
|
||||
//
|
||||
// If not at the end of the list, get the handle
|
||||
//
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
if (Position->Position != &gHandleList) {
|
||||
Handle = CR (Position->Position, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE);
|
||||
}
|
||||
|
||||
return Handle;
|
||||
}
|
||||
|
||||
@@ -89,15 +90,15 @@ SmmGetNextLocateByRegisterNotify (
|
||||
PROTOCOL_INTERFACE *Prot;
|
||||
LIST_ENTRY *Link;
|
||||
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
ProtNotify = Position->SearchKey;
|
||||
|
||||
//
|
||||
// If this is the first request, get the next handle
|
||||
//
|
||||
if (ProtNotify != NULL) {
|
||||
ASSERT(ProtNotify->Signature == PROTOCOL_NOTIFY_SIGNATURE);
|
||||
ASSERT (ProtNotify->Signature == PROTOCOL_NOTIFY_SIGNATURE);
|
||||
Position->SearchKey = NULL;
|
||||
|
||||
//
|
||||
@@ -105,11 +106,12 @@ SmmGetNextLocateByRegisterNotify (
|
||||
//
|
||||
Link = ProtNotify->Position->ForwardLink;
|
||||
if (Link != &ProtNotify->Protocol->Protocols) {
|
||||
Prot = CR (Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);
|
||||
Handle = Prot->Handle;
|
||||
Prot = CR (Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);
|
||||
Handle = Prot->Handle;
|
||||
*Interface = Prot->Interface;
|
||||
}
|
||||
}
|
||||
|
||||
return Handle;
|
||||
}
|
||||
|
||||
@@ -134,13 +136,13 @@ SmmGetNextLocateByProtocol (
|
||||
LIST_ENTRY *Link;
|
||||
PROTOCOL_INTERFACE *Prot;
|
||||
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
for (; ;) {
|
||||
Handle = NULL;
|
||||
*Interface = NULL;
|
||||
for ( ; ;) {
|
||||
//
|
||||
// Next entry
|
||||
//
|
||||
Link = Position->Position->ForwardLink;
|
||||
Link = Position->Position->ForwardLink;
|
||||
Position->Position = Link;
|
||||
|
||||
//
|
||||
@@ -154,8 +156,8 @@ SmmGetNextLocateByProtocol (
|
||||
//
|
||||
// Get the handle
|
||||
//
|
||||
Prot = CR(Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);
|
||||
Handle = Prot->Handle;
|
||||
Prot = CR (Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);
|
||||
Handle = Prot->Handle;
|
||||
*Interface = Prot->Interface;
|
||||
|
||||
//
|
||||
@@ -167,6 +169,7 @@ SmmGetNextLocateByProtocol (
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return Handle;
|
||||
}
|
||||
|
||||
@@ -194,17 +197,17 @@ SmmLocateProtocol (
|
||||
OUT VOID **Interface
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
LOCATE_POSITION Position;
|
||||
PROTOCOL_NOTIFY *ProtNotify;
|
||||
IHANDLE *Handle;
|
||||
EFI_STATUS Status;
|
||||
LOCATE_POSITION Position;
|
||||
PROTOCOL_NOTIFY *ProtNotify;
|
||||
IHANDLE *Handle;
|
||||
|
||||
if ((Interface == NULL) || (Protocol == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*Interface = NULL;
|
||||
Status = EFI_SUCCESS;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
//
|
||||
// Set initial position
|
||||
@@ -223,6 +226,7 @@ SmmLocateProtocol (
|
||||
if (Position.ProtEntry == NULL) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
Position.Position = &Position.ProtEntry->Protocols;
|
||||
|
||||
Handle = SmmGetNextLocateByProtocol (&Position, Interface);
|
||||
@@ -237,7 +241,7 @@ SmmLocateProtocol (
|
||||
// If this is a search by register notify and a handle was
|
||||
// returned, update the register notification position
|
||||
//
|
||||
ProtNotify = Registration;
|
||||
ProtNotify = Registration;
|
||||
ProtNotify->Position = ProtNotify->Position->ForwardLink;
|
||||
}
|
||||
|
||||
@@ -298,51 +302,54 @@ SmmLocateHandle (
|
||||
Position.SearchKey = SearchKey;
|
||||
Position.Position = &gHandleList;
|
||||
|
||||
ResultSize = 0;
|
||||
ResultBuffer = (IHANDLE **) Buffer;
|
||||
Status = EFI_SUCCESS;
|
||||
ResultSize = 0;
|
||||
ResultBuffer = (IHANDLE **)Buffer;
|
||||
Status = EFI_SUCCESS;
|
||||
|
||||
//
|
||||
// Get the search function based on type
|
||||
//
|
||||
switch (SearchType) {
|
||||
case AllHandles:
|
||||
GetNext = SmmGetNextLocateAllHandles;
|
||||
break;
|
||||
case AllHandles:
|
||||
GetNext = SmmGetNextLocateAllHandles;
|
||||
break;
|
||||
|
||||
case ByRegisterNotify:
|
||||
GetNext = SmmGetNextLocateByRegisterNotify;
|
||||
//
|
||||
// Must have SearchKey for locate ByRegisterNotify
|
||||
//
|
||||
if (SearchKey == NULL) {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
}
|
||||
break;
|
||||
case ByRegisterNotify:
|
||||
GetNext = SmmGetNextLocateByRegisterNotify;
|
||||
//
|
||||
// Must have SearchKey for locate ByRegisterNotify
|
||||
//
|
||||
if (SearchKey == NULL) {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
case ByProtocol:
|
||||
GetNext = SmmGetNextLocateByProtocol;
|
||||
if (Protocol == NULL) {
|
||||
break;
|
||||
|
||||
case ByProtocol:
|
||||
GetNext = SmmGetNextLocateByProtocol;
|
||||
if (Protocol == NULL) {
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Look up the protocol entry and set the head pointer
|
||||
//
|
||||
Position.ProtEntry = SmmFindProtocolEntry (Protocol, FALSE);
|
||||
if (Position.ProtEntry == NULL) {
|
||||
Status = EFI_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
Position.Position = &Position.ProtEntry->Protocols;
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
//
|
||||
// Look up the protocol entry and set the head pointer
|
||||
//
|
||||
Position.ProtEntry = SmmFindProtocolEntry (Protocol, FALSE);
|
||||
if (Position.ProtEntry == NULL) {
|
||||
Status = EFI_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
Position.Position = &Position.ProtEntry->Protocols;
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = EFI_INVALID_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
if (EFI_ERROR(Status)) {
|
||||
if (EFI_ERROR (Status)) {
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -350,7 +357,7 @@ SmmLocateHandle (
|
||||
// Enumerate out the matching handles
|
||||
//
|
||||
mEfiLocateHandleRequest += 1;
|
||||
for (; ;) {
|
||||
for ( ; ;) {
|
||||
//
|
||||
// Get the next handle. If no more handles, stop
|
||||
//
|
||||
@@ -363,10 +370,10 @@ SmmLocateHandle (
|
||||
// Increase the resulting buffer size, and if this handle
|
||||
// fits return it
|
||||
//
|
||||
ResultSize += sizeof(Handle);
|
||||
ResultSize += sizeof (Handle);
|
||||
if (ResultSize <= *BufferSize) {
|
||||
*ResultBuffer = Handle;
|
||||
ResultBuffer += 1;
|
||||
*ResultBuffer = Handle;
|
||||
ResultBuffer += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,13 +394,13 @@ SmmLocateHandle (
|
||||
|
||||
*BufferSize = ResultSize;
|
||||
|
||||
if (SearchType == ByRegisterNotify && !EFI_ERROR(Status)) {
|
||||
if ((SearchType == ByRegisterNotify) && !EFI_ERROR (Status)) {
|
||||
ASSERT (SearchKey != NULL);
|
||||
//
|
||||
// If this is a search by register notify and a handle was
|
||||
// returned, update the register notification position
|
||||
//
|
||||
ProtNotify = SearchKey;
|
||||
ProtNotify = SearchKey;
|
||||
ProtNotify->Position = ProtNotify->Position->ForwardLink;
|
||||
}
|
||||
}
|
||||
@@ -444,26 +451,27 @@ SmmLocateHandleBuffer (
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
BufferSize = 0;
|
||||
BufferSize = 0;
|
||||
*NumberHandles = 0;
|
||||
*Buffer = NULL;
|
||||
Status = SmmLocateHandle (
|
||||
SearchType,
|
||||
Protocol,
|
||||
SearchKey,
|
||||
&BufferSize,
|
||||
*Buffer
|
||||
);
|
||||
*Buffer = NULL;
|
||||
Status = SmmLocateHandle (
|
||||
SearchType,
|
||||
Protocol,
|
||||
SearchKey,
|
||||
&BufferSize,
|
||||
*Buffer
|
||||
);
|
||||
//
|
||||
// LocateHandleBuffer() returns incorrect status code if SearchType is
|
||||
// invalid.
|
||||
//
|
||||
// Add code to correctly handle expected errors from SmmLocateHandle().
|
||||
//
|
||||
if (EFI_ERROR(Status) && Status != EFI_BUFFER_TOO_SMALL) {
|
||||
if (EFI_ERROR (Status) && (Status != EFI_BUFFER_TOO_SMALL)) {
|
||||
if (Status != EFI_INVALID_PARAMETER) {
|
||||
Status = EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
||||
@@ -480,8 +488,8 @@ SmmLocateHandleBuffer (
|
||||
*Buffer
|
||||
);
|
||||
|
||||
*NumberHandles = BufferSize / sizeof(EFI_HANDLE);
|
||||
if (EFI_ERROR(Status)) {
|
||||
*NumberHandles = BufferSize / sizeof (EFI_HANDLE);
|
||||
if (EFI_ERROR (Status)) {
|
||||
*NumberHandles = 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user