public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fan, Jeff" <jeff.fan@intel.com>
To: "Marvin Häuser" <Marvin.Haeuser@outlook.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().
Date: Wed, 26 Jul 2017 03:04:22 +0000	[thread overview]
Message-ID: <542CF652F8836A4AB8DBFAAD40ED192A4C62E636@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <AM4PR06MB14911E615F6840956456379D80A40@AM4PR06MB1491.eurprd06.prod.outlook.com>

Reviewed-by: Jeff Fan <jeff.fan@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Marvin Häuser
Sent: Friday, July 21, 2017 6:20 PM
To: edk2-devel@lists.01.org
Cc: Fan, Jeff
Subject: [edk2] [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().

The value returned by GetPageTableBase() is of type UINT64, which is implicitely casted to UINTN by the return statement. To purge the 'possible loss of data' warning on 32-bit platforms, with this patch, the value is casted to UINTN before returning.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
index a535389c26ce..009d8eb01347 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c
@@ -1,6 +1,6 @@
 /** @file
 
-Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials  are licensed and made available under the terms and conditions of the BSD License  which accompanies this distribution.  The full text of the license may be found at @@ -39,7 +39,7 @@ GetPageTableBase (
   VOID
   )
 {
-  return (AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
+  return (UINTN)(AsmReadCr3 () & PAGING_4K_ADDRESS_MASK_64);
 }
 
 /**
--
2.12.2.windows.2

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


  reply	other threads:[~2017-07-26  3:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170721101954.10248-1-Marvin.Haeuser@outlook.com>
2017-07-21 10:20 ` [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase() Marvin Häuser
2017-07-26  3:04   ` Fan, Jeff [this message]
2017-07-21 10:20 ` [PATCH] UefiCpuPkg/CpuCommonFeaturesLib: Fix the documentation of PpinSupport() Marvin Häuser
2017-07-26  3:05   ` Fan, Jeff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542CF652F8836A4AB8DBFAAD40ED192A4C62E636@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox