summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaticharla Venkata Sai <venkatasai.taticharla@amd.com>2025-07-21 10:16:51 +0530
committerVenkata Sai Taticharla <venkatasai.taticharla@amd.com>2026-01-08 16:31:27 +0000
commitbf7901cd6dd76a0d73c581ad7a788225590ba699 (patch)
tree217fbc476aa52f7c285849266cb37a144fcb200a
parenta080ef55039ac603730c4c69a22188c16c3eeb33 (diff)
downloadarm-trusted-firmware-bf7901cd6dd76a0d73c581ad7a788225590ba699.tar.gz
arm-trusted-firmware-bf7901cd6dd76a0d73c581ad7a788225590ba699.zip
fix(optee): add boolean type for expressions
This corrects MISRA violation C2012‑14.4: conditional or loop constructs were using non‑Boolean expressions directly instead of comparisons or Boolean types. The fix replaces them with explicit Boolean tests enforcing that all controlling expressions have essentially Boolean type and improving code clarity and type safety. Change-Id: I150a8a674e8abf9c5409cc3d557af0e288ba1668 Signed-off-by: Taticharla Venkata Sai <venkatasai.taticharla@amd.com>
-rw-r--r--services/spd/opteed/opteed_common.c2
-rw-r--r--services/spd/opteed/opteed_private.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/services/spd/opteed/opteed_common.c b/services/spd/opteed/opteed_common.c
index 8a769fb0b..b0b4204dd 100644
--- a/services/spd/opteed/opteed_common.c
+++ b/services/spd/opteed/opteed_common.c
@@ -40,7 +40,7 @@ void opteed_init_optee_ep_state(struct entry_point_info *optee_entry_point,
/* initialise an entrypoint to set up the CPU context */
ep_attr = SECURE | EP_ST_ENABLE;
- if (read_sctlr_el3() & SCTLR_EE_BIT)
+ if ((read_sctlr_el3() & SCTLR_EE_BIT) != 0U)
ep_attr |= EP_EE_BIG;
SET_PARAM_HEAD(optee_entry_point, PARAM_EP, VERSION_1, ep_attr);
optee_entry_point->pc = pc;
diff --git a/services/spd/opteed/opteed_private.h b/services/spd/opteed/opteed_private.h
index 22fcacdd7..076991f7a 100644
--- a/services/spd/opteed/opteed_private.h
+++ b/services/spd/opteed/opteed_private.h
@@ -32,7 +32,7 @@
clr_optee_pstate(st); \
st |= (pst & OPTEE_PSTATE_MASK) << \
OPTEE_PSTATE_SHIFT; \
- } while (0)
+ } while (false)
/*******************************************************************************