fix(rmm-eac5): fix MISRA C defects
Fixes MISRA C 2012 Rule 2.3, 12.1 and 18.4 violations.
Change-Id: I7b96776da05c636fde89d915b0aae5a7134baab4
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
diff --git a/lib/realm/src/s2tt.c b/lib/realm/src/s2tt.c
index b66dde6..fd6f315 100644
--- a/lib/realm/src/s2tt.c
+++ b/lib/realm/src/s2tt.c
@@ -371,7 +371,8 @@
sl_idx = s2_sl_addr_to_idx(map_addr, start_level, ipa_bits);
if (sl_idx >= S2TTES_PER_S2TT) {
unsigned int tt_num = (unsigned int)(sl_idx >> S2TTE_STRIDE);
- struct granule *g_concat_root = g_root + tt_num;
+ struct granule *g_concat_root = (struct granule *)((uintptr_t)g_root +
+ (tt_num * sizeof(struct granule)));
granule_lock(g_concat_root, GRANULE_STATE_RTT);
granule_unlock(g_root);