From e28224583e86bebf39375b327995c9333f6b7966 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 9 Mar 2020 17:39:27 +0900 Subject: [PATCH] xlat_tables_v2: use ARRAY_SIZE in REGISTER_XLAT_CONTEXT_FULL_SPEC With this, it is clearer that .base_table_entries and .tables_num are the array size of .base_table and .tables, respectively. Change-Id: I634e65aba835ab9908cc3919355df6bc6e18d42a Signed-off-by: Masahiro Yamada --- include/lib/xlat_tables/xlat_tables_v2_helpers.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/lib/xlat_tables/xlat_tables_v2_helpers.h b/include/lib/xlat_tables/xlat_tables_v2_helpers.h index 4a72391a1..62f853d18 100644 --- a/include/lib/xlat_tables/xlat_tables_v2_helpers.h +++ b/include/lib/xlat_tables/xlat_tables_v2_helpers.h @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -160,13 +161,13 @@ struct xlat_ctx { .mmap = _ctx_name##_mmap, \ .mmap_num = (_mmap_count), \ .tables = _ctx_name##_xlat_tables, \ - .tables_num = _xlat_tables_count, \ + .tables_num = ARRAY_SIZE(_ctx_name##_xlat_tables), \ XLAT_CTX_INIT_TABLE_ATTR() \ XLAT_REGISTER_DYNMAP_STRUCT(_ctx_name) \ .next_table = 0, \ .base_table = _ctx_name##_base_xlat_table, \ .base_table_entries = \ - GET_NUM_BASE_LEVEL_ENTRIES(_virt_addr_space_size),\ + ARRAY_SIZE(_ctx_name##_base_xlat_table), \ .max_pa = 0U, \ .max_va = 0U, \ .base_level = GET_XLAT_TABLE_LEVEL_BASE(_virt_addr_space_size),\ -- GitLab