fix(rmm): fix Coverity scan defects
This patch fixes Coverity scan defects below:
- In psci_rsi() function:
Uninitialized scalar variable (UNINIT)
uninit_use: Using uninitialized value result.
Field result.hvc_forward.x1 is uninitialized.
by using structure 'result' initializer, setting
'forward_psci_call' field to 'false' and all
other fields to 0.
- In handle_realm_rsi():
Macro compares unsigned to 0 (NO_EFFECT)
unsigned_compare: This greater-than-or-equal-to-zero
comparison of an unsigned value is always true.
((function_id >> 0U) & 0xffffU) >= 0U.
by removing obsolete checking code of 'function_id'
for invalid ID value, which is handled in default
case of 'switch(function_id)' statement.
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: I9594093f3bdb7d8276b03331192bb310ba10b94f
diff --git a/runtime/rsi/psci.c b/runtime/rsi/psci.c
index 7ab7fd6..4a62685 100644
--- a/runtime/rsi/psci.c
+++ b/runtime/rsi/psci.c
@@ -245,7 +245,7 @@
unsigned long arg1,
unsigned long arg2)
{
- struct psci_result result;
+ struct psci_result result = { false };
switch (function_id) {
case SMC32_PSCI_VERSION:
@@ -262,7 +262,7 @@
arg0 = (unsigned int)arg0;
arg1 = (unsigned int)arg1;
arg2 = (unsigned int)arg2;
- /* Fall through */
+ FALLTHROUGH;
case SMC64_PSCI_CPU_ON:
result = psci_cpu_on(rec, arg0, arg1, arg2);
break;