Fix several coding style violations
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6163 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -172,7 +172,7 @@ CoreDispatchEventNotifies (
|
|||||||
// Only clear the SIGNAL status if it is a SIGNAL type event.
|
// Only clear the SIGNAL status if it is a SIGNAL type event.
|
||||||
// WAIT type events are only cleared in CheckEvent()
|
// WAIT type events are only cleared in CheckEvent()
|
||||||
//
|
//
|
||||||
if (Event->Type & EVT_NOTIFY_SIGNAL) {
|
if ((Event->Type & EVT_NOTIFY_SIGNAL) != 0) {
|
||||||
Event->SignalCount = 0;
|
Event->SignalCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ CoreSignalEvent (
|
|||||||
//
|
//
|
||||||
// If signalling type is a notify function, queue it
|
// If signalling type is a notify function, queue it
|
||||||
//
|
//
|
||||||
if (Event->Type & EVT_NOTIFY_SIGNAL) {
|
if ((Event->Type & EVT_NOTIFY_SIGNAL) != 0) {
|
||||||
if (Event->ExFlag) {
|
if (Event->ExFlag) {
|
||||||
//
|
//
|
||||||
// The CreateEventEx() style requires all members of the Event Group
|
// The CreateEventEx() style requires all members of the Event Group
|
||||||
@ -552,13 +552,13 @@ CoreCheckEvent (
|
|||||||
|
|
||||||
Status = EFI_NOT_READY;
|
Status = EFI_NOT_READY;
|
||||||
|
|
||||||
if (!Event->SignalCount && (Event->Type & EVT_NOTIFY_WAIT)) {
|
if ((Event->SignalCount == 0) && ((Event->Type & EVT_NOTIFY_WAIT) != 0)) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Queue the wait notify function
|
// Queue the wait notify function
|
||||||
//
|
//
|
||||||
CoreAcquireEventLock ();
|
CoreAcquireEventLock ();
|
||||||
if (!Event->SignalCount) {
|
if (Event->SignalCount == 0) {
|
||||||
CoreNotifyEvent (Event);
|
CoreNotifyEvent (Event);
|
||||||
}
|
}
|
||||||
CoreReleaseEventLock ();
|
CoreReleaseEventLock ();
|
||||||
@ -568,10 +568,10 @@ CoreCheckEvent (
|
|||||||
// If the even looks signalled, get the lock and clear it
|
// If the even looks signalled, get the lock and clear it
|
||||||
//
|
//
|
||||||
|
|
||||||
if (Event->SignalCount) {
|
if (Event->SignalCount != 0) {
|
||||||
CoreAcquireEventLock ();
|
CoreAcquireEventLock ();
|
||||||
|
|
||||||
if (Event->SignalCount) {
|
if (Event->SignalCount != 0) {
|
||||||
Event->SignalCount = 0;
|
Event->SignalCount = 0;
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ CoreSetTimer (
|
|||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Type < 0 || Type > TimerRelative || !(Event->Type & EVT_TIMER)) {
|
if (Type < 0 || Type > TimerRelative || (Event->Type & EVT_TIMER) == 0) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ FwVolBlockGetPhysicalAddress (
|
|||||||
|
|
||||||
FvbDevice = FVB_DEVICE_FROM_THIS (This);
|
FvbDevice = FVB_DEVICE_FROM_THIS (This);
|
||||||
|
|
||||||
if (FvbDevice->FvbAttributes & EFI_FVB2_MEMORY_MAPPED) {
|
if ((FvbDevice->FvbAttributes & EFI_FVB2_MEMORY_MAPPED) != 0) {
|
||||||
*Address = FvbDevice->BaseAddress;
|
*Address = FvbDevice->BaseAddress;
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -640,7 +640,7 @@ CoreDisconnectControllersUsingProtocolInterface (
|
|||||||
(Link != &Prot->OpenList) && !ItemFound;
|
(Link != &Prot->OpenList) && !ItemFound;
|
||||||
Link = Link->ForwardLink ) {
|
Link = Link->ForwardLink ) {
|
||||||
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
||||||
if (OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) {
|
if ((OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
ItemFound = TRUE;
|
ItemFound = TRUE;
|
||||||
CoreReleaseProtocolLock ();
|
CoreReleaseProtocolLock ();
|
||||||
Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL);
|
Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL);
|
||||||
@ -663,8 +663,8 @@ CoreDisconnectControllersUsingProtocolInterface (
|
|||||||
(Link != &Prot->OpenList) && !ItemFound;
|
(Link != &Prot->OpenList) && !ItemFound;
|
||||||
Link = Link->ForwardLink ) {
|
Link = Link->ForwardLink ) {
|
||||||
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
||||||
if (OpenData->Attributes &
|
if ((OpenData->Attributes &
|
||||||
(EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL | EFI_OPEN_PROTOCOL_GET_PROTOCOL | EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) {
|
(EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL | EFI_OPEN_PROTOCOL_GET_PROTOCOL | EFI_OPEN_PROTOCOL_TEST_PROTOCOL)) != 0) {
|
||||||
ItemFound = TRUE;
|
ItemFound = TRUE;
|
||||||
RemoveEntryList (&OpenData->Link);
|
RemoveEntryList (&OpenData->Link);
|
||||||
Prot->OpenListCount--;
|
Prot->OpenListCount--;
|
||||||
@ -1086,14 +1086,14 @@ CoreOpenProtocol (
|
|||||||
ExactMatch = (BOOLEAN)((OpenData->AgentHandle == ImageHandle) &&
|
ExactMatch = (BOOLEAN)((OpenData->AgentHandle == ImageHandle) &&
|
||||||
(OpenData->Attributes == Attributes) &&
|
(OpenData->Attributes == Attributes) &&
|
||||||
(OpenData->ControllerHandle == ControllerHandle));
|
(OpenData->ControllerHandle == ControllerHandle));
|
||||||
if (OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) {
|
if ((OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
ByDriver = TRUE;
|
ByDriver = TRUE;
|
||||||
if (ExactMatch) {
|
if (ExactMatch) {
|
||||||
Status = EFI_ALREADY_STARTED;
|
Status = EFI_ALREADY_STARTED;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (OpenData->Attributes & EFI_OPEN_PROTOCOL_EXCLUSIVE) {
|
if ((OpenData->Attributes & EFI_OPEN_PROTOCOL_EXCLUSIVE) != 0) {
|
||||||
Exclusive = TRUE;
|
Exclusive = TRUE;
|
||||||
} else if (ExactMatch) {
|
} else if (ExactMatch) {
|
||||||
OpenData->OpenCount++;
|
OpenData->OpenCount++;
|
||||||
@ -1127,7 +1127,7 @@ CoreOpenProtocol (
|
|||||||
Disconnect = FALSE;
|
Disconnect = FALSE;
|
||||||
for ( Link = Prot->OpenList.ForwardLink; (Link != &Prot->OpenList) && (!Disconnect); Link = Link->ForwardLink) {
|
for ( Link = Prot->OpenList.ForwardLink; (Link != &Prot->OpenList) && (!Disconnect); Link = Link->ForwardLink) {
|
||||||
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
OpenData = CR (Link, OPEN_PROTOCOL_DATA, Link, OPEN_PROTOCOL_DATA_SIGNATURE);
|
||||||
if (OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) {
|
if ((OpenData->Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) {
|
||||||
Disconnect = TRUE;
|
Disconnect = TRUE;
|
||||||
CoreReleaseProtocolLock ();
|
CoreReleaseProtocolLock ();
|
||||||
Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL);
|
Status = CoreDisconnectController (UserHandle, OpenData->AgentHandle, NULL);
|
||||||
|
@ -1424,18 +1424,18 @@ CoreTerminateMemoryMap (
|
|||||||
|
|
||||||
for (Link = gMemoryMap.ForwardLink; Link != &gMemoryMap; Link = Link->ForwardLink) {
|
for (Link = gMemoryMap.ForwardLink; Link != &gMemoryMap; Link = Link->ForwardLink) {
|
||||||
Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
|
Entry = CR(Link, MEMORY_MAP, Link, MEMORY_MAP_SIGNATURE);
|
||||||
if (Entry->Attribute & EFI_MEMORY_RUNTIME) {
|
if ((Entry->Attribute & EFI_MEMORY_RUNTIME) != 0) {
|
||||||
if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) {
|
if (Entry->Type == EfiACPIReclaimMemory || Entry->Type == EfiACPIMemoryNVS) {
|
||||||
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));
|
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: ACPI memory entry has RUNTIME attribute set.\n"));
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
if (Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
|
if ((Entry->Start & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {
|
||||||
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
|
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
goto Done;
|
goto Done;
|
||||||
}
|
}
|
||||||
if ((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) {
|
if (((Entry->End + 1) & (EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT - 1)) != 0) {
|
||||||
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
|
DEBUG((DEBUG_ERROR | DEBUG_PAGE, "ExitBootServices: A RUNTIME memory entry is not on a proper alignment.\n"));
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
goto Done;
|
goto Done;
|
||||||
|
@ -656,7 +656,7 @@ CreateChildNode (
|
|||||||
// Make sure we initialize the new stream with the correct
|
// Make sure we initialize the new stream with the correct
|
||||||
// authentication status for both aggregate and local status fields.
|
// authentication status for both aggregate and local status fields.
|
||||||
//
|
//
|
||||||
if (GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {
|
if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) != 0) {
|
||||||
//
|
//
|
||||||
// OR in the parent stream's aggregate status.
|
// OR in the parent stream's aggregate status.
|
||||||
//
|
//
|
||||||
@ -685,7 +685,7 @@ CreateChildNode (
|
|||||||
//
|
//
|
||||||
// There's no GUIDed section extraction protocol available.
|
// There's no GUIDed section extraction protocol available.
|
||||||
//
|
//
|
||||||
if (GuidedHeader->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) {
|
if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
|
||||||
//
|
//
|
||||||
// If the section REQUIRES an extraction protocol, then we're toast
|
// If the section REQUIRES an extraction protocol, then we're toast
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user