]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
IntelFrameworkModulePkg: Refine casting expression result to bigger size
[mirror_edk2.git] / IntelFrameworkModulePkg / Csm / LegacyBiosDxe / LegacyBios.c
index dd2e2b9167c72c009c30ddcbe2b5519799c5a459..3ead2d98280929b0192ecf1222c02f9023db9fd2 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -144,7 +144,7 @@ LegacyBiosGetLegacyRegion (
      );\r
 \r
   if (Regs.X.AX == 0) {\r
-    *LegacyMemoryAddress  = (VOID *) (UINTN) ((Regs.X.DS << 4) + Regs.X.BX);\r
+    *LegacyMemoryAddress  = (VOID *) (((UINTN) Regs.X.DS << 4) + Regs.X.BX);\r
     Status = EFI_SUCCESS;\r
   } else {\r
     Status = EFI_OUT_OF_RESOURCES;\r
@@ -728,7 +728,7 @@ InstallSmbiosEventCallback (
   }\r
   \r
   if ((mStructureTableAddress != 0) && \r
-      (mStructureTablePages < (UINTN) EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength))) {\r
+      (mStructureTablePages < EFI_SIZE_TO_PAGES ((UINT32)EntryPointStructure->TableLength))) {\r
     //\r
     // If original buffer is not enough for the new SMBIOS table, free original buffer and re-allocate\r
     //\r