]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EmulatorPkg/FvbServicesRuntimeDxe/FWBlockService.c
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / EmulatorPkg / FvbServicesRuntimeDxe / FWBlockService.c
index 9513d05bed594774c9c89948efc5999e6b19460e..fdffca2c9449d6a816f26f6f7166ed1586c9346f 100644 (file)
@@ -1,6 +1,6 @@
 /*++ @file\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 Portions copyright (c) 2011, Apple Inc. All rights reserved.\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -906,19 +906,15 @@ Returns:
       break;\r
     }\r
 \r
-    NumOfLba = VA_ARG (args, UINT32);\r
+    NumOfLba = VA_ARG (args, UINTN);\r
 \r
     //\r
     // Check input parameters\r
     //\r
-    if (NumOfLba == 0) {\r
+    if (NumOfLba == 0 || (StartingLba + NumOfLba) > NumOfBlocks) {\r
       VA_END (args);\r
       return EFI_INVALID_PARAMETER;\r
     }\r
-\r
-    if ((StartingLba + NumOfLba) > NumOfBlocks) {\r
-      return EFI_INVALID_PARAMETER;\r
-    }\r
   } while (1);\r
 \r
   VA_END (args);\r
@@ -930,7 +926,7 @@ Returns:
       break;\r
     }\r
 \r
-    NumOfLba = VA_ARG (args, UINT32);\r
+    NumOfLba = VA_ARG (args, UINTN);\r
 \r
     while (NumOfLba > 0) {\r
       Status = FvbEraseBlock (FvbDevice->Instance, StartingLba, mFvbModuleGlobal, EfiGoneVirtual ());\r