]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c
SecurityPkg: Refine type cast for pointer subtraction
[mirror_edk2.git] / SecurityPkg / Library / Tpm2CommandLib / Tpm2Help.c
index 64d3c531ff92247af2bf4169ba93abfc38112519..180f36083096f86e76011bb195e0aa9c89fb8387 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implement TPM2 help.\r
 \r
-Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved. <BR>\r
+Copyright (c) 2013 - 2017, Intel Corporation. All rights reserved. <BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -141,7 +141,7 @@ CopyAuthSessionCommand (
     Buffer += sizeof(UINT16);\r
   }\r
 \r
-  return (UINT32)(UINTN)(Buffer - (UINT8 *)AuthSessionOut);\r
+  return (UINT32)((UINTN)Buffer - (UINTN)AuthSessionOut);\r
 }\r
 \r
 /**\r
@@ -186,7 +186,7 @@ CopyAuthSessionResponse (
   CopyMem (AuthSessionOut->hmac.buffer, Buffer, AuthSessionOut->hmac.size);\r
   Buffer += AuthSessionOut->hmac.size;\r
 \r
-  return (UINT32)(UINTN)(Buffer - (UINT8 *)AuthSessionIn);\r
+  return (UINT32)((UINTN)Buffer - (UINTN)AuthSessionIn);\r
 }\r
 \r
 /**\r