]> git.proxmox.com Git - mirror_edk2.git/commit
ArmPkg/ArmMmuLib ARM: simplify assignment of TTBR0 system register
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 5 Mar 2020 12:36:14 +0000 (13:36 +0100)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 5 Mar 2020 21:08:30 +0000 (21:08 +0000)
commita17add32c2466d2185073b3d4ce7a03a3374a692
tree69383d220e5602150cd1af89e5a3e5b87219b756
parenta2ab46adbc6184248878eba3e3c479a3f253ba27
ArmPkg/ArmMmuLib ARM: simplify assignment of TTBR0 system register

The expression passed into ArmSetTTBR0 () in ArmConfigureMmu() is
sub-optimal at several levels:
- TranslationTable is already aligned, and if it wasn't, doing it
  here wouldn't help
- TTBRAttributes is guaranteed not to have any bits set outside of
  the 0x7f mask, so the mask operation is pointless as well,
- an additional (UINTN) cast for good measure is also not needed.

So simplify the expression.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c