diff --git a/plat/common/aarch64/plat_common.c b/plat/common/aarch64/plat_common.c index 7a228b976..ba47b30a0 100644 --- a/plat/common/aarch64/plat_common.c +++ b/plat/common/aarch64/plat_common.c @@ -78,19 +78,27 @@ int plat_sdei_validate_entry_point(uintptr_t ep, unsigned int client_mode) const char *get_el_str(unsigned int el) { + const char *mode = NULL; + switch (el) { case MODE_EL3: - return "EL3"; + mode = "EL3"; + break; case MODE_EL2: - return "EL2"; + mode = "EL2"; + break; case MODE_EL1: - return "EL1"; + mode = "EL1"; + break; case MODE_EL0: - return "EL0"; + mode = "EL0"; + break; default: assert(false); - return NULL; + break; } + + return mode; } #if FFH_SUPPORT diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c index 05df97add..6a2d09032 100644 --- a/plat/common/plat_gicv2.c +++ b/plat/common/plat_gicv2.c @@ -48,8 +48,9 @@ uint32_t plat_ic_get_pending_interrupt_id(void) unsigned int id; id = gicv2_get_pending_interrupt_id(); - if (id == GIC_SPURIOUS_INTERRUPT) - return INTR_ID_UNAVAILABLE; + if (id == GIC_SPURIOUS_INTERRUPT) { + id = INTR_ID_UNAVAILABLE; + } return id; } @@ -68,22 +69,27 @@ uint32_t plat_ic_get_pending_interrupt_id(void) uint32_t plat_ic_get_pending_interrupt_type(void) { unsigned int id; + uint32_t interrupt_type; id = gicv2_get_pending_interrupt_type(); /* Assume that all secure interrupts are S-EL1 interrupts */ if (id < PENDING_G1_INTID) { #if GICV2_G0_FOR_EL3 - return INTR_TYPE_EL3; + interrupt_type = INTR_TYPE_EL3; #else - return INTR_TYPE_S_EL1; + interrupt_type = INTR_TYPE_S_EL1; #endif + } else { + + if (id == GIC_SPURIOUS_INTERRUPT) { + interrupt_type = INTR_TYPE_INVAL; + } else { + interrupt_type = INTR_TYPE_NS; + } } - if (id == GIC_SPURIOUS_INTERRUPT) { - return INTR_TYPE_INVAL; - } - return INTR_TYPE_NS; + return interrupt_type; } /*