public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael Kubacki" <mikuback@linux.microsoft.com>
To: devel@edk2.groups.io
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: [edk2-devel] [PATCH v1 1/2] ArmPkg/Drivers/CpuDxe: Explicitly cast table entry
Date: Mon, 27 Nov 2023 19:14:59 -0500	[thread overview]
Message-ID: <20231128001500.1107-2-mikuback@linux.microsoft.com> (raw)
In-Reply-To: <20231128001500.1107-1-mikuback@linux.microsoft.com>

From: Michael Kubacki <michael.kubacki@microsoft.com>

GetNextEntryAttribute() assigns a 64-bit integer to 32-bit integers.

This change explicitly casts the assigned value as UINT32 to prevent
the following Visual Studio compiler warning:

  '=': conversion from 'UINT64' to 'UINT32', possible loss of data

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
index e14eb47ce4c6..4555fdb5c2c8 100644
--- a/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
+++ b/ArmPkg/Drivers/CpuDxe/AArch64/Mmu.c
@@ -195,8 +195,8 @@ GetNextEntryAttribute (
   // the subsequent ones should be filled up
   for (Index = 0; Index < EntryCount; Index++) {
     Entry          = TableAddress[Index];
-    EntryType      = Entry & TT_TYPE_MASK;
-    EntryAttribute = Entry & TT_ATTRIBUTES_MASK;
+    EntryType      = (UINT32)(Entry & TT_TYPE_MASK);
+    EntryAttribute = (UINT32)(Entry & TT_ATTRIBUTES_MASK);
 
     // If Entry is a Table Descriptor type entry then go through the sub-level table
     if ((EntryType == TT_TYPE_BLOCK_ENTRY) ||
-- 
2.42.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111767): https://edk2.groups.io/g/devel/message/111767
Mute This Topic: https://groups.io/mt/102842002/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-11-28  0:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  0:14 [edk2-devel] [PATCH v1 0/2] ArmPkg/CpuDxe: Use upper and lower attributes Michael Kubacki
2023-11-28  0:14 ` Michael Kubacki [this message]
2023-11-28  0:15 ` [edk2-devel] [PATCH v1 2/2] ArmPkg/Drivers/CpuDxe: Use lower and upper attributes Michael Kubacki
2023-11-28  9:51 ` [edk2-devel] [PATCH v1 0/2] ArmPkg/CpuDxe: Use upper and lower attributes Ard Biesheuvel
2023-11-28 17:15   ` Michael Kubacki
2023-11-28 17:35     ` Ard Biesheuvel

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=20231128001500.1107-2-mikuback@linux.microsoft.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