aboutsummaryrefslogtreecommitdiff
path: root/lib/aarch64
diff options
context:
space:
mode:
authorVikram Kanigiri <vikram.kanigiri@arm.com>2015-03-04 10:34:27 +0000
committerVikram Kanigiri <vikram.kanigiri@arm.com>2015-03-16 18:37:34 +0000
commita7e98ad5145bb57fd18d199f915c76ef376cf227 (patch)
treeb73a3f97e20741461f98f65d6967cb9f5ac1ea69 /lib/aarch64
parent5930eadbe5d8d4c3f15fd910476f72cd5bf86f44 (diff)
downloadtrusted-firmware-a-a7e98ad5145bb57fd18d199f915c76ef376cf227.tar.gz
Add macro to calculate number of elements in an array
This patch defines the ARRAY_SIZE macro for calculating number of elements in an array and uses it where appropriate. Change-Id: I72746a9229f0b259323972b498b9a3999731bc9b
Diffstat (limited to 'lib/aarch64')
-rw-r--r--lib/aarch64/xlat_tables.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/aarch64/xlat_tables.c b/lib/aarch64/xlat_tables.c
index ddc9ba88cb..fa1a03dabf 100644
--- a/lib/aarch64/xlat_tables.c
+++ b/lib/aarch64/xlat_tables.c
@@ -31,6 +31,7 @@
#include <arch.h>
#include <arch_helpers.h>
#include <assert.h>
+#include <bl_common.h>
#include <cassert.h>
#include <platform_def.h>
#include <string.h>
@@ -89,7 +90,7 @@ void mmap_add_region(unsigned long base_pa, unsigned long base_va,
unsigned long size, unsigned attr)
{
mmap_region_t *mm = mmap;
- mmap_region_t *mm_last = mm + sizeof(mmap) / sizeof(mmap[0]) - 1;
+ mmap_region_t *mm_last = mm + ARRAY_SIZE(mmap) - 1;
unsigned long pa_end = base_pa + size - 1;
unsigned long va_end = base_va + size - 1;