Browse Source

fix(plat/xilinx/versal): resolve misra R14.4

MISRA Violation: MISRA-C:2012 R.14.4
- The controlling expression of an if statement and the controlling
  expression of an iteration-statement shall have essentially Boolean type.

Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com>
Change-Id: I8cf821a42015858200cc0c514600012c8f61061f
pull/1978/merge
Abhyuday Godhasara 3 years ago
parent
commit
a62c40d427
  1. 6
      plat/xilinx/versal/bl31_versal_setup.c
  2. 2
      plat/xilinx/versal/plat_psci.c
  3. 2
      plat/xilinx/versal/plat_versal.c

6
plat/xilinx/versal/bl31_versal_setup.c

@ -127,7 +127,7 @@ static interrupt_type_handler_t type_el3_interrupt_handler;
int request_intr_type_el3(uint32_t id, interrupt_type_handler_t handler)
{
/* Validate 'handler'*/
if (!handler) {
if (handler == NULL) {
return -EINVAL;
}
@ -150,7 +150,7 @@ static uint64_t rdo_el3_interrupt_handler(uint32_t id, uint32_t flags,
}
handler = type_el3_interrupt_handler;
if (handler) {
if (handler != NULL) {
return handler(intr_id, flags, handle, cookie);
}
@ -171,7 +171,7 @@ void bl31_plat_runtime_setup(void)
set_interrupt_rm_flag(flags, NON_SECURE);
rc = register_interrupt_type_handler(INTR_TYPE_EL3,
rdo_el3_interrupt_handler, flags);
if (rc) {
if (rc != 0) {
panic();
}
}

2
plat/xilinx/versal/plat_psci.c

@ -205,7 +205,7 @@ static int versal_validate_power_state(unsigned int power_state,
}
/* We expect the 'state id' to be zero */
if (psci_get_pstate_id(power_state)) {
if (psci_get_pstate_id(power_state) != 0U) {
return PSCI_E_INVALID_PARAMS;
}

2
plat/xilinx/versal/plat_versal.c

@ -9,7 +9,7 @@
int plat_core_pos_by_mpidr(u_register_t mpidr)
{
if (mpidr & MPIDR_CLUSTER_MASK) {
if ((mpidr & MPIDR_CLUSTER_MASK) != 0U) {
return -1;
}

Loading…
Cancel
Save