From 649c48f5dca1765eabd42b5d630736a5d1e1f5e2 Mon Sep 17 00:00:00 2001 From: Jonathan Wright Date: Wed, 14 Mar 2018 15:24:00 +0000 Subject: 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 --- plat/mediatek/common/custom/oem_svc.c | 11 ++--------- plat/mediatek/common/mtk_sip_svc.c | 3 +++ 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'plat/mediatek') diff --git a/plat/mediatek/common/custom/oem_svc.c b/plat/mediatek/common/custom/oem_svc.c index 08baed87..49e7571d 100644 --- a/plat/mediatek/common/custom/oem_svc.c +++ b/plat/mediatek/common/custom/oem_svc.c @@ -41,15 +41,8 @@ uint64_t oem_smc_handler(uint32_t smc_fid, void *handle, uint64_t flags) { - uint64_t rc; - - switch (smc_fid) { - default: - rc = SMC_UNK; - WARN("Unimplemented OEM Call: 0x%x\n", smc_fid); - } - - SMC_RET1(handle, rc); + WARN("Unimplemented OEM Call: 0x%x\n", smc_fid); + SMC_RET1(handle, SMC_UNK); } /* diff --git a/plat/mediatek/common/mtk_sip_svc.c b/plat/mediatek/common/mtk_sip_svc.c index beb2a697..869a9590 100644 --- a/plat/mediatek/common/mtk_sip_svc.c +++ b/plat/mediatek/common/mtk_sip_svc.c @@ -71,6 +71,9 @@ uint64_t mediatek_sip_handler(uint32_t smc_fid, boot_to_kernel(x1, x2, x3, x4); SMC_RET0(handle); #endif + default: + /* Do nothing in default case */ + break; } } -- cgit v1.2.3