]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
MdeModulePkg: Refine type cast for pointer subtraction
[mirror_edk2.git] / MdeModulePkg / Library / PiDxeS3BootScriptLib / BootScriptSave.c
index 5698c916639952056700dba391e8ece5b25600b9..1f8aaf47c8753b8651c691ecd0934642c0aecd1e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Save the S3 data to S3 boot script.\r
 \r
-  Copyright (c) 2006 - 2016, 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
@@ -2025,7 +2025,7 @@ S3BootScriptCalculateInsertAddress (
    // calculate the Position offset\r
    //\r
    if (Position != NULL) {\r
-     PositionOffset = (UINTN) ((UINT8 *)Position - S3TableBase);\r
+     PositionOffset = (UINTN)Position - (UINTN)S3TableBase;\r
 \r
      //\r
      // If the BeforeOrAfter is FALSE, that means to insert the node right after the node.\r