]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the prediction warnings in DxeMain.
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 9 May 2008 07:52:58 +0000 (07:52 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 9 May 2008 07:52:58 +0000 (07:52 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5190 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Event/event.c
MdeModulePkg/Core/Dxe/FwVol/FwVol.c
MdeModulePkg/Core/Dxe/Gcd/gcd.c
MdeModulePkg/Core/Dxe/Image/Image.c
MdeModulePkg/Core/Dxe/Image/ImageFile.c
MdeModulePkg/Core/Dxe/Mem/Page.c

index f5ffbb7d4df3d4eadad764c1bf5efd1caff0baeb..834ace59e792d0960fb515850ece434d2d999589 100644 (file)
@@ -358,7 +358,7 @@ CoreCreateEventEx (
   //\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
@@ -381,7 +381,7 @@ CoreCreateEventEx (
   // 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
@@ -404,7 +404,7 @@ CoreCreateEventEx (
 \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
index bdf87731fb9f88fb01eb063c3d1b7e1c7e45dee4..ed81cd464d4ef284ab700c29bece520df0c4ba65 100644 (file)
@@ -272,7 +272,7 @@ FvCheck (
   //\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
index b6a0f1b763b0d9f41165b7c9074a16b355fba734..bff13b3bf666148325e72545e0045c12932b0cfe 100644 (file)
@@ -586,11 +586,11 @@ CoreConvertSpace (
   }\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
@@ -666,7 +666,7 @@ CoreConvertSpace (
     // 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
@@ -775,10 +775,10 @@ CoreConvertSpace (
   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
@@ -902,11 +902,11 @@ CoreAllocateSpace (
   }\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
@@ -1073,10 +1073,10 @@ CoreAllocateSpace (
   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
index 7c66f07d760dc4f56f2b0c9797504b75a9d08e12..0770399cd99bf522648af6cb267331b879148be4 100644 (file)
@@ -332,7 +332,7 @@ CoreLoadPeImage (
   // 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
@@ -432,7 +432,7 @@ CoreLoadPeImage (
   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
@@ -754,7 +754,7 @@ CoreLoadImageCommon (
   //\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
@@ -1014,7 +1014,7 @@ CoreStartImage (
   // 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
index 7cb2576c4f501d7b3e40d6247db6155d1a4bd1b1..d3f28e2a265231516cc69e3b554e3056dccded84 100644 (file)
@@ -467,7 +467,7 @@ CoreGrowBuffer (
   //\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
index 9ec83141ac50a3dc608eafe2301b8de1f0298a85..190715e2710c56a54822503df3c5b9b8d1cfa5d8 100644 (file)
@@ -557,7 +557,7 @@ CoreFreeMemoryMapStack (
   //\r
   // If already freeing the map stack, then return\r
   //\r
-  if (mFreeMapStack) {\r
+  if (mFreeMapStack != 0) {\r
     return ;\r
   }\r
 \r
@@ -566,7 +566,7 @@ CoreFreeMemoryMapStack (
   //\r
   mFreeMapStack += 1;\r
 \r
-  while (mMapDepth) {\r
+  while (mMapDepth != 0) {\r
     //\r
     // Deque an memory map entry from mFreeMemoryMapEntryList \r
     //\r
@@ -730,7 +730,7 @@ CoreConvertPages (
   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
@@ -1042,9 +1042,9 @@ FindFreePages (
   }\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