summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c
diff options
context:
space:
mode:
authorMichael Kubacki <michael.kubacki@microsoft.com>2020-10-19 15:02:50 -0700
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-10-22 14:48:12 +0000
commit2bdc90429a149af6c0e88506730123586b6e08ae (patch)
tree29c33bc8b19be08e928d8a0b9a59013cf2d7369b /ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c
parent24cf72726564eac7ba9abb24f3d05795164d0a70 (diff)
downloadedk2-2bdc90429a149af6c0e88506730123586b6e08ae.tar.gz
edk2-2bdc90429a149af6c0e88506730123586b6e08ae.tar.bz2
edk2-2bdc90429a149af6c0e88506730123586b6e08ae.zip
ArmPkg/ArmMmuLib: Explicitly cast UINT32 data conversions
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2835 There's several occurrences of a UINT64 or an EFI_PHYSICAL_ADDRESS being assigned to a UINT32 value in ArmMmuLib. These result in warning C4244 in VS2019: warning C4244: '=': conversion from 'UINT64' to 'UINT32', possible loss of data warning C4244: '=': conversion from 'EFI_PHYSICAL_ADDRESS' to 'UINT32', possible loss of data This change explicitly casts the values to UINT32. These can be reproduced with the following build command: build -b DEBUG -a ARM -t VS2019 -p ArmPkg/ArmPkg.dsc -m ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c')
-rw-r--r--ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c
index 1ec734deab..6f18604f79 100644
--- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c
+++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c
@@ -152,7 +152,7 @@ UpdatePageEntries (
FirstLevelTable = (ARM_FIRST_LEVEL_DESCRIPTOR *)ArmGetTTBR0BaseAddress ();
// Calculate number of 4KB page table entries to change
- NumPageEntries = Length / TT_DESCRIPTOR_PAGE_SIZE;
+ NumPageEntries = (UINT32)(Length / TT_DESCRIPTOR_PAGE_SIZE);
// Iterate for the number of 4KB pages to change
Offset = 0;
@@ -288,7 +288,7 @@ UpdateSectionEntries (
ASSERT (FirstLevelIdx < TRANSLATION_TABLE_SECTION_COUNT);
// calculate number of 1MB first level entries this applies to
- NumSections = Length / TT_DESCRIPTOR_SECTION_SIZE;
+ NumSections = (UINT32)(Length / TT_DESCRIPTOR_SECTION_SIZE);
// iterate through each descriptor
for(i=0; i<NumSections; i++) {