summaryrefslogtreecommitdiff
path: root/lib/extensions/sve
diff options
context:
space:
mode:
authorAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-25 16:52:26 +0100
committerAntonio Nino Diaz <antonio.ninodiaz@arm.com>2018-10-29 14:41:48 +0000
commit40daecc1be51383c806c0ac953303e47026abcac (patch)
tree62f705b7a8c4e21c3d6cafeead88165f364ce34b /lib/extensions/sve
parent4012531547f63595f33e493dcd7ebd1730dfcedc (diff)
Fix MISRA defects in extension libs
No functional changes. Change-Id: I2f28f20944f552447ac4e9e755493cd7c0ea1192 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Diffstat (limited to 'lib/extensions/sve')
-rw-r--r--lib/extensions/sve/sve.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/extensions/sve/sve.c b/lib/extensions/sve/sve.c
index 64424878..e031bf61 100644
--- a/lib/extensions/sve/sve.c
+++ b/lib/extensions/sve/sve.c
@@ -7,21 +7,22 @@
#include <arch.h>
#include <arch_helpers.h>
#include <pubsub.h>
+#include <stdbool.h>
#include <sve.h>
-int sve_supported(void)
+bool sve_supported(void)
{
uint64_t features;
features = read_id_aa64pfr0_el1() >> ID_AA64PFR0_SVE_SHIFT;
- return (features & ID_AA64PFR0_SVE_MASK) == 1;
+ return (features & ID_AA64PFR0_SVE_MASK) == 1U;
}
static void *disable_sve_hook(const void *arg)
{
uint64_t cptr;
- if (sve_supported() == 0)
+ if (!sve_supported())
return (void *)-1;
/*
@@ -39,14 +40,14 @@ static void *disable_sve_hook(const void *arg)
* No explicit ISB required here as ERET to switch to Secure
* world covers it
*/
- return 0;
+ return (void *)0;
}
static void *enable_sve_hook(const void *arg)
{
uint64_t cptr;
- if (sve_supported() == 0)
+ if (!sve_supported())
return (void *)-1;
/*
@@ -60,14 +61,14 @@ static void *enable_sve_hook(const void *arg)
* No explicit ISB required here as ERET to switch to Non-secure
* world covers it
*/
- return 0;
+ return (void *)0;
}
-void sve_enable(int el2_unused)
+void sve_enable(bool el2_unused)
{
uint64_t cptr;
- if (sve_supported() == 0)
+ if (!sve_supported())
return;
#if CTX_INCLUDE_FPREGS