From: Michael Kubacki <[email protected]>

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 <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Cc: Sami Mujawar <[email protected]>
Signed-off-by: Michael Kubacki <[email protected]>
---
 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/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to