aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-25 17:11:02 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-29 14:41:48 +0000
commit435349977cad43f4635ca39e0171d7a0d3092a57 (patch)
tree55099de266d005bb0cf8cb8f6460f7da4f5832c3 /lib
parent15b94cc18db135145c3322be69897bcd956e7d7f (diff)
downloadplatform_external_arm-trusted-firmware-435349977cad43f4635ca39e0171d7a0d3092a57.tar.gz
platform_external_arm-trusted-firmware-435349977cad43f4635ca39e0171d7a0d3092a57.tar.bz2
platform_external_arm-trusted-firmware-435349977cad43f4635ca39e0171d7a0d3092a57.zip
Fix MISRA defects in workaround and errata framework
No functional changes. Change-Id: Iaab0310848be587b635ce5339726e92a50f534e0 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/cpus/aarch64/cortex_a75_pubsub.c6
-rw-r--r--lib/cpus/aarch64/cortex_ares_pubsub.c6
-rw-r--r--lib/cpus/errata_report.c11
3 files changed, 14 insertions, 9 deletions
diff --git a/lib/cpus/aarch64/cortex_a75_pubsub.c b/lib/cpus/aarch64/cortex_a75_pubsub.c
index 16f62f472..f4ca48606 100644
--- a/lib/cpus/aarch64/cortex_a75_pubsub.c
+++ b/lib/cpus/aarch64/cortex_a75_pubsub.c
@@ -12,14 +12,16 @@ static void *cortex_a75_context_save(const void *arg)
{
if (midr_match(CORTEX_A75_MIDR) != 0)
cpuamu_context_save(CORTEX_A75_AMU_NR_COUNTERS);
- return 0;
+
+ return (void *)0;
}
static void *cortex_a75_context_restore(const void *arg)
{
if (midr_match(CORTEX_A75_MIDR) != 0)
cpuamu_context_restore(CORTEX_A75_AMU_NR_COUNTERS);
- return 0;
+
+ return (void *)0;
}
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_a75_context_save);
diff --git a/lib/cpus/aarch64/cortex_ares_pubsub.c b/lib/cpus/aarch64/cortex_ares_pubsub.c
index c7d850a00..9566223f2 100644
--- a/lib/cpus/aarch64/cortex_ares_pubsub.c
+++ b/lib/cpus/aarch64/cortex_ares_pubsub.c
@@ -12,14 +12,16 @@ static void *cortex_ares_context_save(const void *arg)
{
if (midr_match(CORTEX_ARES_MIDR) != 0)
cpuamu_context_save(CORTEX_ARES_AMU_NR_COUNTERS);
- return 0;
+
+ return (void *)0;
}
static void *cortex_ares_context_restore(const void *arg)
{
if (midr_match(CORTEX_ARES_MIDR) != 0)
cpuamu_context_restore(CORTEX_ARES_AMU_NR_COUNTERS);
- return 0;
+
+ return (void *)0;
}
SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_ares_context_save);
diff --git a/lib/cpus/errata_report.c b/lib/cpus/errata_report.c
index c679336c1..42603cb6d 100644
--- a/lib/cpus/errata_report.c
+++ b/lib/cpus/errata_report.c
@@ -12,6 +12,7 @@
#include <debug.h>
#include <errata_report.h>
#include <spinlock.h>
+#include <stdbool.h>
#include <utils.h>
#ifdef IMAGE_BL1
@@ -35,10 +36,10 @@
*/
int errata_needs_reporting(spinlock_t *lock, uint32_t *reported)
{
- int report_now;
+ bool report_now;
/* If already reported, return false. */
- if (*reported)
+ if (*reported != 0U)
return 0;
/*
@@ -46,7 +47,7 @@ int errata_needs_reporting(spinlock_t *lock, uint32_t *reported)
* report status to true.
*/
spin_lock(lock);
- report_now = !(*reported);
+ report_now = (*reported == 0U);
if (report_now)
*reported = 1;
spin_unlock(lock);
@@ -75,8 +76,8 @@ void errata_print_msg(unsigned int status, const char *cpu, const char *id)
assert(status < ARRAY_SIZE(errata_status_str));
- assert(cpu);
- assert(id);
+ assert(cpu != NULL);
+ assert(id != NULL);
msg = errata_status_str[status];