aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDimitris Papastamos <dimitris.papastamos@arm.com>2018-03-29 13:20:05 +0100
committerGitHub <noreply@github.com>2018-03-29 13:20:05 +0100
commit6ab136c258ed4616d8cf1ebf1c5a4a74b75d35bc (patch)
tree59d6d3499fff950a6a5e18593f2166cd9d0c6565 /lib
parent875a85aae6b0c9ae411ed899f827c4bbc0703438 (diff)
parent185a23ffa3b6fc007021ac9bbab2213c63911c0a (diff)
downloadplatform_external_arm-trusted-firmware-6ab136c258ed4616d8cf1ebf1c5a4a74b75d35bc.tar.gz
platform_external_arm-trusted-firmware-6ab136c258ed4616d8cf1ebf1c5a4a74b75d35bc.tar.bz2
platform_external_arm-trusted-firmware-6ab136c258ed4616d8cf1ebf1c5a4a74b75d35bc.zip
Merge pull request #1313 from jonathanwright-ARM/jw/MISRA-switch-statements
Fix switch statements to comply with MISRA rules
Diffstat (limited to 'lib')
-rw-r--r--lib/pmf/pmf_smc.c12
-rw-r--r--lib/psci/psci_main.c2
2 files changed, 4 insertions, 10 deletions
diff --git a/lib/pmf/pmf_smc.c b/lib/pmf/pmf_smc.c
index 5cf193e21..e86611802 100644
--- a/lib/pmf/pmf_smc.c
+++ b/lib/pmf/pmf_smc.c
@@ -30,8 +30,7 @@ uintptr_t pmf_smc_handler(unsigned int smc_fid,
x2 = (uint32_t)x2;
x3 = (uint32_t)x3;
- switch (smc_fid) {
- case PMF_SMC_GET_TIMESTAMP_32:
+ if (smc_fid == PMF_SMC_GET_TIMESTAMP_32) {
/*
* Return error code and the captured
* time-stamp to the caller.
@@ -41,13 +40,9 @@ uintptr_t pmf_smc_handler(unsigned int smc_fid,
rc = pmf_get_timestamp_smc(x1, x2, x3, &ts_value);
SMC_RET3(handle, rc, (uint32_t)ts_value,
(uint32_t)(ts_value >> 32));
-
- default:
- break;
}
} else {
- switch (smc_fid) {
- case PMF_SMC_GET_TIMESTAMP_64:
+ if (smc_fid == PMF_SMC_GET_TIMESTAMP_64) {
/*
* Return error code and the captured
* time-stamp to the caller.
@@ -56,9 +51,6 @@ uintptr_t pmf_smc_handler(unsigned int smc_fid,
*/
rc = pmf_get_timestamp_smc(x1, x2, x3, &ts_value);
SMC_RET2(handle, rc, ts_value);
-
- default:
- break;
}
}
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c
index d25d1775c..607d0cd50 100644
--- a/lib/psci/psci_main.c
+++ b/lib/psci/psci_main.c
@@ -414,10 +414,12 @@ u_register_t psci_smc_handler(uint32_t smc_fid,
case PSCI_SYSTEM_OFF:
psci_system_off();
/* We should never return from psci_system_off() */
+ break;
case PSCI_SYSTEM_RESET:
psci_system_reset();
/* We should never return from psci_system_reset() */
+ break;
case PSCI_FEATURES:
return psci_features(x1);