diff options
author | Jonathan Wright <jonathan.wright@arm.com> | 2018-03-14 15:24:00 +0000 |
---|---|---|
committer | Jonathan Wright <jonathan.wright@arm.com> | 2018-03-26 12:43:05 +0100 |
commit | 649c48f5dca1765eabd42b5d630736a5d1e1f5e2 (patch) | |
tree | 48e9700b7154e62d0e8b43e732346e3929b938a3 /plat/common | |
parent | 3eacacc0ef6a8beefd858ff36cbc35e2b9ff5b07 (diff) | |
download | arm-trusted-firmware-649c48f5dca1765eabd42b5d630736a5d1e1f5e2.tar.gz |
plat: fix switch statements to comply with MISRA rules
Ensure (where possible) that switch statements in plat comply with MISRA
rules 16.1 - 16.7.
Change-Id: Ie4a7d2fd10f6141c0cfb89317ea28a755391622f
Signed-off-by: Jonathan Wright <jonathan.wright@arm.com>
Diffstat (limited to 'plat/common')
-rw-r--r-- | plat/common/plat_gicv2.c | 12 | ||||
-rw-r--r-- | plat/common/plat_gicv3.c | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/plat/common/plat_gicv2.c b/plat/common/plat_gicv2.c index ca6c03b01..026ea7132 100644 --- a/plat/common/plat_gicv2.c +++ b/plat/common/plat_gicv2.c @@ -190,6 +190,8 @@ void plat_ic_set_interrupt_priority(unsigned int id, unsigned int priority) int plat_ic_has_interrupt_type(unsigned int type) { + int has_interrupt_type = 0; + switch (type) { #if GICV2_G0_FOR_EL3 case INTR_TYPE_EL3: @@ -197,10 +199,14 @@ int plat_ic_has_interrupt_type(unsigned int type) case INTR_TYPE_S_EL1: #endif case INTR_TYPE_NS: - return 1; + has_interrupt_type = 1; + break; default: - return 0; + /* Do nothing in default case */ + break; } + + return has_interrupt_type; } void plat_ic_set_interrupt_type(unsigned int id, unsigned int type) @@ -221,6 +227,7 @@ void plat_ic_set_interrupt_type(unsigned int id, unsigned int type) break; default: assert(0); + break; } gicv2_set_interrupt_type(id, gicv2_type); @@ -260,6 +267,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode, break; default: assert(0); + break; } gicv2_set_spi_routing(id, proc_num); diff --git a/plat/common/plat_gicv3.c b/plat/common/plat_gicv3.c index cf9aca229..26a4973f9 100644 --- a/plat/common/plat_gicv3.c +++ b/plat/common/plat_gicv3.c @@ -247,6 +247,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode, break; default: assert(0); + break; } gicv3_set_spi_routing(id, irm, mpidr); |