diff options
author | Dimitris Papastamos <dimitris.papastamos@arm.com> | 2018-06-12 13:01:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-12 13:01:35 +0100 |
commit | e109b0ffea07c6987cfb9f8668d8a90c246aab34 (patch) | |
tree | 56cc5a7bd06f3f77c108c0df8380d7c0849e8fe6 /lib | |
parent | 42be6fc57e4f543a6a5a79f3a3d13192fb346fe2 (diff) | |
parent | bdcd33a858eb14a59128f142376c3735e9df65c9 (diff) | |
download | platform_external_arm-trusted-firmware-e109b0ffea07c6987cfb9f8668d8a90c246aab34.tar.gz platform_external_arm-trusted-firmware-e109b0ffea07c6987cfb9f8668d8a90c246aab34.tar.bz2 platform_external_arm-trusted-firmware-e109b0ffea07c6987cfb9f8668d8a90c246aab34.zip |
Merge pull request #1391 from jts-arm/misra
MISRA rule 21.15 fix
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xlat_tables_v2/xlat_tables_internal.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/xlat_tables_v2/xlat_tables_internal.c b/lib/xlat_tables_v2/xlat_tables_internal.c index 8be6d942d..31d3365b9 100644 --- a/lib/xlat_tables_v2/xlat_tables_internal.c +++ b/lib/xlat_tables_v2/xlat_tables_internal.c @@ -735,7 +735,7 @@ static int mmap_add_region_check(xlat_ctx_t *ctx, const mmap_region_t *mm) void mmap_add_region_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm) { - mmap_region_t *mm_cursor = ctx->mmap; + mmap_region_t *mm_cursor = ctx->mmap, *mm_destination; const mmap_region_t *mm_end = ctx->mmap + ctx->mmap_num; mmap_region_t *mm_last; unsigned long long end_pa = mm->base_pa + mm->size - 1; @@ -802,9 +802,10 @@ void mmap_add_region_ctx(xlat_ctx_t *ctx, const mmap_region_t *mm) * that there is free space. */ assert(mm_last->size == 0U); - + /* Make room for new region by moving other regions up by one place */ - memmove(mm_cursor + 1, mm_cursor, + mm_destination = mm_cursor + 1; + memmove(mm_destination, mm_cursor, (uintptr_t)mm_last - (uintptr_t)mm_cursor); /* |