summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-06-21 14:39:16 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-06-22 08:36:21 +0100
commit3a1b7b108aec527597075b48aa929a622fff23da (patch)
treec39255926ad02695b329b03263efb55db370a3de /lib/utils
parent6d769420b098f36717c99d4a6a2455fd6bd8fd23 (diff)
xlat: Remove mmap_attr_t enum type
The values defined in this type are used in logical operations, which goes against MISRA Rule 10.1: "Operands shall not be of an inappropriate essential type". Now, `unsigned int` is used instead. This also allows us to move the dynamic mapping bit from 30 to 31. It was an undefined behaviour in the past because an enum is signed by default, and bit 31 corresponds to the sign bit. It is undefined behaviour to modify the sign bit. Now, bit 31 is free to use as it was originally meant to be. mmap_attr_t is now defined as an `unsigned int` for backwards compatibility. Change-Id: I6b31218c14b9c7fdabebe432de7fae6e90a97f34 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/mem_region.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/mem_region.c b/lib/utils/mem_region.c
index 24c2c1de..e9541ba3 100644
--- a/lib/utils/mem_region.c
+++ b/lib/utils/mem_region.c
@@ -58,7 +58,7 @@ void clear_map_dyn_mem_regions(mem_region_t *regions,
uintptr_t begin;
int r;
size_t size;
- const mmap_attr_t attr = MT_MEMORY|MT_RW|MT_NS;
+ const unsigned int attr = MT_MEMORY | MT_RW | MT_NS;
assert(regions != NULL);
assert(nregions > 0 && chunk > 0);