diff options
author | David Cunado <david.cunado@arm.com> | 2017-06-21 16:52:45 +0100 |
---|---|---|
committer | David Cunado <david.cunado@arm.com> | 2017-06-27 09:57:21 +0100 |
commit | 0dd4195114c8d2b6f8be5b00c3b8011a548fe1ae (patch) | |
tree | c6a9cef690c3509ae8131e045934ec931e8471cc /lib/xlat_tables | |
parent | 73e11b4321fa8b0d7032175e1ddf65a4a320847c (diff) |
Resolve signed-unsigned comparison issues
A recent commit 030567e6f51731982a7e71cbd387de93bc0e35fd added U()/ULL()
macro to TF constants. This has caused some signed-unsigned comparison
warnings / errors in the TF static analysis.
This patch addresses these issues by migrating impacted variables from
signed ints to unsigned ints and vice verse where applicable.
Change-Id: I4b4c739a3fa64aaf13b69ad1702c66ec79247e53
Signed-off-by: David Cunado <david.cunado@arm.com>
Diffstat (limited to 'lib/xlat_tables')
-rw-r--r-- | lib/xlat_tables/xlat_tables_common.c | 14 | ||||
-rw-r--r-- | lib/xlat_tables/xlat_tables_private.h | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/xlat_tables/xlat_tables_common.c b/lib/xlat_tables/xlat_tables_common.c index 17e7e6e0..c6fa10ee 100644 --- a/lib/xlat_tables/xlat_tables_common.c +++ b/lib/xlat_tables/xlat_tables_common.c @@ -23,9 +23,9 @@ #define LVL2_SPACER " " #define LVL3_SPACER " " #define get_level_spacer(level) \ - (((level) == 0) ? LVL0_SPACER : \ - (((level) == 1) ? LVL1_SPACER : \ - (((level) == 2) ? LVL2_SPACER : LVL3_SPACER))) + (((level) == U(0)) ? LVL0_SPACER : \ + (((level) == U(1)) ? LVL1_SPACER : \ + (((level) == U(2)) ? LVL2_SPACER : LVL3_SPACER))) #define debug_print(...) tf_printf(__VA_ARGS__) #else #define debug_print(...) ((void)0) @@ -36,7 +36,7 @@ static uint64_t xlat_tables[MAX_XLAT_TABLES][XLAT_TABLE_ENTRIES] __aligned(XLAT_TABLE_SIZE) __section("xlat_table"); -static unsigned next_xlat; +static unsigned int next_xlat; static unsigned long long xlat_max_pa; static uintptr_t xlat_max_va; @@ -178,7 +178,7 @@ void mmap_add(const mmap_region_t *mm) } static uint64_t mmap_desc(mmap_attr_t attr, unsigned long long addr_pa, - int level) + unsigned int level) { uint64_t desc; int mem_type; @@ -309,7 +309,7 @@ static int mmap_region_attr(mmap_region_t *mm, uintptr_t base_va, static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm, uintptr_t base_va, uint64_t *table, - int level) + unsigned int level) { assert(level >= XLAT_TABLE_LEVEL_MIN && level <= XLAT_TABLE_LEVEL_MAX); @@ -378,7 +378,7 @@ static mmap_region_t *init_xlation_table_inner(mmap_region_t *mm, } void init_xlation_table(uintptr_t base_va, uint64_t *table, - int level, uintptr_t *max_va, + unsigned int level, uintptr_t *max_va, unsigned long long *max_pa) { execute_never_mask = xlat_arch_get_xn_desc(xlat_arch_current_el()); diff --git a/lib/xlat_tables/xlat_tables_private.h b/lib/xlat_tables/xlat_tables_private.h index 92078525..b5c3ac84 100644 --- a/lib/xlat_tables/xlat_tables_private.h +++ b/lib/xlat_tables/xlat_tables_private.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2016-2017, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -77,7 +77,7 @@ int xlat_arch_current_el(void); uint64_t xlat_arch_get_xn_desc(int el); void init_xlation_table(uintptr_t base_va, uint64_t *table, - int level, uintptr_t *max_va, + unsigned int level, uintptr_t *max_va, unsigned long long *max_pa); #endif /* __XLAT_TABLES_PRIVATE_H__ */ |