public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Marvin Häuser" <Marvin.Haeuser@outlook.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "jeff.fan@intel.com" <jeff.fan@intel.com>
Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase().
Date: Fri, 21 Jul 2017 10:20:16 +0000	[thread overview]
Message-ID: <AM4PR06MB14911E615F6840956456379D80A40@AM4PR06MB1491.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <20170721101954.10248-1-Marvin.Haeuser@outlook.com>

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



       reply	other threads:[~2017-07-21 10:18 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 ` Marvin Häuser [this message]
2017-07-26  3:04   ` [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Cast the return value of GetPageTableBase() Fan, Jeff
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=AM4PR06MB14911E615F6840956456379D80A40@AM4PR06MB1491.eurprd06.prod.outlook.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