]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Misc.c
IntelFrameworkModulePkg: Refine casting expression result to bigger size
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / BiosThunk / Snp16Dxe / Misc.c
index 4750b2f99d9c2d8c55ab69f26d81832ef9a7fdcf..a1dc86786b1d4514df7e0af884433e4bdf87a569 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Helper Routines that use a PXE-enabled NIC option ROM.\r
  \r
-Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -49,7 +49,7 @@ CacheVectorAddress (
 {\r
   UINT32  *Address;\r
 \r
-  Address                          = (UINT32 *)(UINTN) (IVT_BASE + VectorNumber * 4);\r
+  Address                          = (UINT32 *) ((UINTN) IVT_BASE + VectorNumber * 4);\r
   CachedVectorAddress[VectorNumber] = *Address;\r
   return EFI_SUCCESS;\r
 }\r
@@ -68,7 +68,7 @@ RestoreCachedVectorAddress (
 {\r
   UINT32  *Address;\r
 \r
-  Address  = (UINT32 *)(UINTN) (IVT_BASE + VectorNumber * 4);\r
+  Address  = (UINT32 *) ((UINTN) IVT_BASE + VectorNumber * 4);\r
   *Address = CachedVectorAddress[VectorNumber];\r
   return EFI_SUCCESS;\r
 }\r
@@ -469,7 +469,7 @@ LaunchBaseCode (
 \r
   RomIdTableAddress = (UNDI_ROMID_T *) (RomAddress + OPTION_ROM_PTR->PxeRomIdOffset);\r
 \r
-  if ((UINTN) (OPTION_ROM_PTR->PxeRomIdOffset + RomIdTableAddress->StructLength) > RomLength) {\r
+  if (((UINT32)OPTION_ROM_PTR->PxeRomIdOffset + RomIdTableAddress->StructLength) > RomLength) {\r
     DEBUG ((DEBUG_ERROR, "ROM ID Offset Error\n\r"));\r
     return EFI_NOT_FOUND;\r
   }\r
@@ -754,10 +754,10 @@ LaunchBaseCode (
   Print_Undi_Loader_Table (UndiLoaderTable);\r
 \r
   DEBUG ((DEBUG_NET, "Display the PXENV+ and !PXE tables exported by NIC\n\r"));\r
-  Print_PXENV_Table ((VOID *)(UINTN)((UndiLoaderTable->PXENVptr.Segment << 4) | UndiLoaderTable->PXENVptr.Offset));\r
-  Print_PXE_Table ((VOID *)(UINTN)((UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset));\r
+  Print_PXENV_Table ((VOID *)(((UINTN)UndiLoaderTable->PXENVptr.Segment << 4) | UndiLoaderTable->PXENVptr.Offset));\r
+  Print_PXE_Table ((VOID *)(((UINTN)UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset));\r
 \r
-  Pxe = (PXE_T *)(UINTN)((UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset);\r
+  Pxe = (PXE_T *)(((UINTN)UndiLoaderTable->PXEptr.Segment << 4) + UndiLoaderTable->PXEptr.Offset);\r
   SimpleNetworkDevice->Nii.Id = (UINT64)(UINTN) Pxe;\r
 \r
   gBS->FreePool (Buffer);\r