diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2017-09-18 22:11:34 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-09-18 23:53:56 +0200 |
commit | 591cf2e1614572552aa952717eb40927aaa471c3 (patch) | |
tree | 5381dc024fa22beafd916383abc681cebc5599db | |
parent | eefa0a647d34aaa09ceeb1781d5d81a4994d8b6a (diff) | |
download | u-boot-591cf2e1614572552aa952717eb40927aaa471c3.zip u-boot-591cf2e1614572552aa952717eb40927aaa471c3.tar.gz u-boot-591cf2e1614572552aa952717eb40927aaa471c3.tar.bz2 |
efi_loader: avoid obscure constants in efi_runtime.c
We should use the predefined constants EFI_PAGE_SHIFT
and EFI_PAGE_MASK where applicable.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | lib/efi_loader/efi_runtime.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index ad7f375..47b0376 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -243,7 +243,8 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map) /* Check if the relocation is inside bounds */ if (map && ((newaddr < map->virtual_start) || - newaddr > (map->virtual_start + (map->num_pages << 12)))) { + newaddr > (map->virtual_start + + (map->num_pages << EFI_PAGE_SHIFT)))) { if (!efi_runtime_tobedetached(p)) printf("U-Boot EFI: Relocation at %p is out of " "range (%lx)\n", p, newaddr); @@ -269,7 +270,8 @@ static efi_status_t EFIAPI efi_set_virtual_address_map( uint32_t descriptor_version, struct efi_mem_desc *virtmap) { - ulong runtime_start = (ulong)&__efi_runtime_start & ~0xfffULL; + ulong runtime_start = (ulong)&__efi_runtime_start & + ~(ulong)EFI_PAGE_MASK; int n = memory_map_size / descriptor_size; int i; |