//\r
// If it's a notify type of event, check its parameters\r
//\r
- if ((Type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL))) {\r
+ if ((Type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) != 0) {\r
//\r
// Check for an invalid NotifyFunction or NotifyTpl\r
//\r
// Allcoate and initialize a new event structure.\r
//\r
Status = CoreAllocatePool (\r
- (Type & EVT_RUNTIME) ? EfiRuntimeServicesData: EfiBootServicesData,\r
+ ((Type & EVT_RUNTIME) != 0) ? EfiRuntimeServicesData: EfiBootServicesData,\r
sizeof (IEVENT),\r
(VOID **)&IEvent\r
);\r
\r
*Event = IEvent;\r
\r
- if (Type & EVT_RUNTIME) {\r
+ if ((Type & EVT_RUNTIME) != 0) {\r
//\r
// Keep a list of all RT events so we can tell the RT AP.\r
//\r
//\r
// Scan to check the free space & File list\r
//\r
- if (FvbAttributes & EFI_FVB2_ERASE_POLARITY) {\r
+ if ((FvbAttributes & EFI_FVB2_ERASE_POLARITY) != 0) {\r
FvDevice->ErasePolarity = 1;\r
} else {\r
FvDevice->ErasePolarity = 0;\r
}\r
\r
Map = NULL;\r
- if (Operation & GCD_MEMORY_SPACE_OPERATION) {\r
+ if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdMemoryLock ();\r
Map = &mGcdMemorySpaceMap;\r
}\r
- if (Operation & GCD_IO_SPACE_OPERATION) {\r
+ if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdIoLock ();\r
Map = &mGcdIoSpaceMap;\r
}\r
// Set attribute operations\r
//\r
case GCD_SET_ATTRIBUTES_MEMORY_OPERATION:\r
- if (Attributes & EFI_MEMORY_RUNTIME) {\r
+ if ((Attributes & EFI_MEMORY_RUNTIME) != 0) {\r
if ((BaseAddress & EFI_PAGE_MASK) != 0 || (Length & EFI_PAGE_MASK) != 0) {\r
Status = EFI_INVALID_PARAMETER;\r
\r
Status = CoreCleanupGcdMapEntry (TopEntry, BottomEntry, StartLink, EndLink, Map);\r
\r
Done:\r
- if (Operation & GCD_MEMORY_SPACE_OPERATION) {\r
+ if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreReleaseGcdMemoryLock ();\r
}\r
- if (Operation & GCD_IO_SPACE_OPERATION) {\r
+ if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
CoreReleaseGcdIoLock ();\r
}\r
\r
}\r
\r
Map = NULL;\r
- if (Operation & GCD_MEMORY_SPACE_OPERATION) {\r
+ if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdMemoryLock ();\r
Map = &mGcdMemorySpaceMap;\r
}\r
- if (Operation & GCD_IO_SPACE_OPERATION) {\r
+ if ((Operation & GCD_IO_SPACE_OPERATION) != 0) {\r
CoreAcquireGcdIoLock ();\r
Map = &mGcdIoSpaceMap;\r
}\r
Status = CoreCleanupGcdMapEntry (TopEntry, BottomEntry, StartLink, EndLink, Map);\r
\r
Done:\r
- if (Operation & GCD_MEMORY_SPACE_OPERATION) {\r
+ if ((Operation & GCD_MEMORY_SPACE_OPERATION) != 0) {\r
CoreReleaseGcdMemoryLock ();\r
}\r
- if (Operation & GCD_IO_SPACE_OPERATION) {\r
+ if ((Operation & GCD_IO_SPACE_OPERATION) !=0) {\r
CoreReleaseGcdIoLock ();\r
}\r
\r
// is used to relocate the image when SetVirtualAddressMap() is called. The\r
// relocation is done by the Runtime AP.\r
//\r
- if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) {\r
+ if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) != 0) {\r
if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {\r
Image->ImageContext.FixupData = CoreAllocateRuntimePool ((UINTN)(Image->ImageContext.FixupDataSize));\r
if (Image->ImageContext.FixupData == NULL) {\r
Image->Info.ImageSize = Image->ImageContext.ImageSize;\r
Image->Info.ImageCodeType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageCodeMemoryType);\r
Image->Info.ImageDataType = (EFI_MEMORY_TYPE) (Image->ImageContext.ImageDataMemoryType);\r
- if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) {\r
+ if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_RUNTIME_REGISTRATION) != 0) {\r
if (Image->ImageContext.ImageType == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) {\r
//\r
// Make a list off all the RT images so we can let the RT AP know about them.\r
//\r
// Register the image in the Debug Image Info Table if the attribute is set\r
//\r
- if (Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION) {\r
+ if ((Attribute & EFI_LOAD_PE_IMAGE_ATTRIBUTE_DEBUG_IMAGE_INFO_TABLE_REGISTRATION) != 0) {\r
CoreNewDebugImageInfoEntry (EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL, &Image->Info, Image->Handle);\r
}\r
\r
// The initial call to SetJump() must always return 0.\r
// Subsequent calls to LongJump() cause a non-zero value to be returned by SetJump().\r
//\r
- if (!SetJumpFlag) {\r
+ if (SetJumpFlag == 0) {\r
//\r
// Call the image's entry point\r
//\r
//\r
// If there's an error, free the buffer\r
//\r
- if ((!TryAgain) && (EFI_ERROR (*Status)) && (*Buffer)) {\r
+ if ((!TryAgain) && (EFI_ERROR (*Status)) && (*Buffer != NULL)) {\r
CoreFreePool (*Buffer);\r
*Buffer = NULL;\r
}\r
//\r
// If already freeing the map stack, then return\r
//\r
- if (mFreeMapStack) {\r
+ if (mFreeMapStack != 0) {\r
return ;\r
}\r
\r
//\r
mFreeMapStack += 1;\r
\r
- while (mMapDepth) {\r
+ while (mMapDepth != 0) {\r
//\r
// Deque an memory map entry from mFreeMemoryMapEntryList \r
//\r
ASSERT (End > Start) ;\r
ASSERT_LOCKED (&gMemoryLock);\r
\r
- if (NumberOfPages == 0 || (Start & EFI_PAGE_MASK ) || (Start > (Start + NumberOfBytes))) {\r
+ if (NumberOfPages == 0 || ((Start & EFI_PAGE_MASK) != 0) || (Start > (Start + NumberOfBytes))) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
}\r
\r
Start = CoreFindFreePagesI (NewMaxAddress, NoPages, NewType, Alignment);\r
- if (!Start) {\r
+ if (Start == 0) {\r
Start = CoreFindFreePagesI (MaxAddress, NoPages, NewType, Alignment);\r
- if (!Start) {\r
+ if (Start == 0) {\r
//\r
// Here means there may be no enough memory to use, so try to go through\r
// all the memory descript to promote the untested memory directly\r