Unverified Commit 6ab136c2 authored by Dimitris Papastamos's avatar Dimitris Papastamos Committed by GitHub
Browse files

Merge pull request #1313 from jonathanwright-ARM/jw/MISRA-switch-statements

Fix switch statements to comply with MISRA rules
parents 875a85aa 185a23ff
......@@ -19,9 +19,6 @@ uint64_t rockchip_plat_sip_handler(uint32_t smc_fid,
void *handle,
uint64_t flags)
{
switch (smc_fid) {
default:
ERROR("%s: unhandled SMC (0x%x)\n", __func__, smc_fid);
SMC_RET1(handle, SMC_UNK);
}
ERROR("%s: unhandled SMC (0x%x)\n", __func__, smc_fid);
SMC_RET1(handle, SMC_UNK);
}
......@@ -207,6 +207,9 @@ static void sdram_timing_cfg_init(struct timing_related_config *ptiming_config,
ptiming_config->rdbi = 0;
ptiming_config->wdbi = 0;
break;
default:
/* Do nothing in default case */
break;
}
ptiming_config->dramds = drv_config->dram_side_drv;
ptiming_config->dramodt = drv_config->dram_side_dq_odt;
......
......@@ -1314,5 +1314,8 @@ void dram_get_parameter(struct timing_related_config *timing_config,
case LPDDR4:
lpddr4_get_parameter(timing_config, pdram_timing);
break;
default:
/* Do nothing in default case */
break;
}
}
......@@ -310,6 +310,7 @@ static int pmu_set_power_domain(uint32_t pd_id, uint32_t pd_state)
pmu_bus_idle_req(BUS_ID_PERIHP, state);
break;
default:
/* Do nothing in default case */
break;
}
......@@ -647,12 +648,8 @@ int rockchip_soc_cores_pwr_dm_off(void)
int rockchip_soc_hlvl_pwr_dm_off(uint32_t lvl,
plat_local_state_t lvl_state)
{
switch (lvl) {
case MPIDR_AFFLVL1:
if (lvl == MPIDR_AFFLVL1) {
clst_pwr_domain_suspend(lvl_state);
break;
default:
break;
}
return PSCI_E_SUCCESS;
......@@ -675,12 +672,8 @@ int rockchip_soc_cores_pwr_dm_suspend(void)
int rockchip_soc_hlvl_pwr_dm_suspend(uint32_t lvl, plat_local_state_t lvl_state)
{
switch (lvl) {
case MPIDR_AFFLVL1:
if (lvl == MPIDR_AFFLVL1) {
clst_pwr_domain_suspend(lvl_state);
break;
default:
break;
}
return PSCI_E_SUCCESS;
......@@ -698,12 +691,8 @@ int rockchip_soc_cores_pwr_dm_on_finish(void)
int rockchip_soc_hlvl_pwr_dm_on_finish(uint32_t lvl,
plat_local_state_t lvl_state)
{
switch (lvl) {
case MPIDR_AFFLVL1:
if (lvl == MPIDR_AFFLVL1) {
clst_pwr_domain_resume(lvl_state);
break;
default:
break;
}
return PSCI_E_SUCCESS;
......@@ -721,11 +710,8 @@ int rockchip_soc_cores_pwr_dm_resume(void)
int rockchip_soc_hlvl_pwr_dm_resume(uint32_t lvl, plat_local_state_t lvl_state)
{
switch (lvl) {
case MPIDR_AFFLVL1:
if (lvl == MPIDR_AFFLVL1) {
clst_pwr_domain_resume(lvl_state);
default:
break;
}
return PSCI_E_SUCCESS;
......
......@@ -81,6 +81,9 @@ int bl2_plat_handle_post_image_load(unsigned int image_id)
bl_mem_params->ep_info.spsr = rpi3_get_spsr_for_bl33_entry();
break;
default:
/* Do nothing in default case */
break;
}
return err;
......
......@@ -85,6 +85,7 @@ void bl2_el3_plat_arch_setup(void)
break;
default:
plat_error_handler(-ENOTSUP);
break;
}
if (!skip_scp) {
......
......@@ -48,6 +48,9 @@ unsigned int zynqmp_get_uart_clk(void)
return 25000000;
case ZYNQMP_CSU_VERSION_QEMU:
return 133000000;
default:
/* Do nothing in default case */
break;
}
return 100000000;
......@@ -187,6 +190,9 @@ static void zynqmp_print_platform_name(void)
case ZYNQMP_CSU_VERSION_SILICON:
label = "silicon";
break;
default:
/* Do nothing in default case */
break;
}
NOTICE("ATF running on XCZU%s/%s v%d/RTL%d.%d at 0x%x%s\n",
......@@ -258,6 +264,9 @@ unsigned int plat_get_syscnt_freq2(void)
return 4000000;
case ZYNQMP_CSU_VERSION_QEMU:
return 50000000;
default:
/* Do nothing in default case */
break;
}
return mmio_read_32(IOU_SCNTRS_BASEFREQ);
......
......@@ -311,6 +311,7 @@ uint64_t opteed_smc_handler(uint32_t smc_fid,
* OPTEE. Jump back to the original C runtime context.
*/
opteed_synchronous_sp_exit(optee_ctx, x1);
break;
/*
......@@ -345,6 +346,7 @@ uint64_t opteed_smc_handler(uint32_t smc_fid,
* return value to the caller
*/
opteed_synchronous_sp_exit(optee_ctx, x1);
break;
/*
* OPTEE is returning from a call or being preempted from a call, in
......
......@@ -49,6 +49,7 @@ uint64_t tlkd_va_translate(uintptr_t va, int type)
break;
default:
assert(0);
break;
}
/* get the (NS/S) physical address */
......
......@@ -350,6 +350,7 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
* context.
*/
tlkd_synchronous_sp_exit(&tlk_ctx, x1);
break;
/*
* These function IDs are used only by TLK to indicate it has
......@@ -375,6 +376,7 @@ uint64_t tlkd_smc_handler(uint32_t smc_fid,
* return value to the caller
*/
tlkd_synchronous_sp_exit(&tlk_ctx, x1);
break;
/*
* Return the number of service function IDs implemented to
......
......@@ -435,6 +435,7 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
* context.
*/
tspd_synchronous_sp_exit(tsp_ctx, x1);
break;
#endif
/*
* This function ID is used only by the SP to indicate it has finished
......@@ -475,6 +476,7 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
* return value to the caller
*/
tspd_synchronous_sp_exit(tsp_ctx, x1);
break;
/*
* Request from non-secure client to perform an
......@@ -591,7 +593,6 @@ uint64_t tspd_smc_handler(uint32_t smc_fid,
SMC_RET3(ns_cpu_context, x1, x2, x3);
}
break;
/*
* Request from the non-secure world to abort a preempted Yielding SMC
* Call.
......
......@@ -916,7 +916,6 @@ uint64_t sdei_smc_handler(uint32_t smc_fid,
ret = sdei_version();
SDEI_LOG("< VER:%lx\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_REGISTER:
x5 = SMC_GET_GP(handle, CTX_GPREG_X5);
......@@ -925,32 +924,27 @@ uint64_t sdei_smc_handler(uint32_t smc_fid,
ret = sdei_event_register(x1, x2, x3, x4, x5);
SDEI_LOG("< REG:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_ENABLE:
SDEI_LOG("> ENABLE(n:%d)\n", (int) x1);
ret = sdei_event_enable(x1);
SDEI_LOG("< ENABLE:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_DISABLE:
SDEI_LOG("> DISABLE(n:%d)\n", (int) x1);
ret = sdei_event_disable(x1);
SDEI_LOG("< DISABLE:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_CONTEXT:
SDEI_LOG("> CTX(p:%d):%lx\n", (int) x1, read_mpidr_el1());
ret = sdei_event_context(handle, x1);
SDEI_LOG("< CTX:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_COMPLETE_AND_RESUME:
resume = 1;
/* Fall through */
case SDEI_EVENT_COMPLETE:
SDEI_LOG("> COMPLETE(r:%d sta/ep:%lx):%lx\n", resume, x1,
......@@ -969,92 +963,81 @@ uint64_t sdei_smc_handler(uint32_t smc_fid,
SMC_RET1(handle, ret);
SMC_RET0(handle);
break;
case SDEI_EVENT_STATUS:
SDEI_LOG("> STAT(n:%d)\n", (int) x1);
ret = sdei_event_status(x1);
SDEI_LOG("< STAT:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_GET_INFO:
SDEI_LOG("> INFO(n:%d, %d)\n", (int) x1, (int) x2);
ret = sdei_event_get_info(x1, x2);
SDEI_LOG("< INFO:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_UNREGISTER:
SDEI_LOG("> UNREG(n:%d)\n", (int) x1);
ret = sdei_event_unregister(x1);
SDEI_LOG("< UNREG:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_PE_UNMASK:
SDEI_LOG("> UNMASK:%lx\n", read_mpidr_el1());
sdei_pe_unmask();
SDEI_LOG("< UNMASK:%d\n", 0);
SMC_RET1(handle, 0);
break;
case SDEI_PE_MASK:
SDEI_LOG("> MASK:%lx\n", read_mpidr_el1());
ret = sdei_pe_mask();
SDEI_LOG("< MASK:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_INTERRUPT_BIND:
SDEI_LOG("> BIND(%d)\n", (int) x1);
ret = sdei_interrupt_bind(x1);
SDEI_LOG("< BIND:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_INTERRUPT_RELEASE:
SDEI_LOG("> REL(%d)\n", (int) x1);
ret = sdei_interrupt_release(x1);
SDEI_LOG("< REL:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_SHARED_RESET:
SDEI_LOG("> S_RESET():%lx\n", read_mpidr_el1());
ret = sdei_shared_reset();
SDEI_LOG("< S_RESET:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_PRIVATE_RESET:
SDEI_LOG("> P_RESET():%lx\n", read_mpidr_el1());
ret = sdei_private_reset();
SDEI_LOG("< P_RESET:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_ROUTING_SET:
SDEI_LOG("> ROUTE_SET(n:%d f:%lx aff:%lx)\n", (int) x1, x2, x3);
ret = sdei_event_routing_set(x1, x2, x3);
SDEI_LOG("< ROUTE_SET:%ld\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_FEATURES:
SDEI_LOG("> FTRS(f:%lx)\n", x1);
ret = sdei_features(x1);
SDEI_LOG("< FTRS:%lx\n", ret);
SMC_RET1(handle, ret);
break;
case SDEI_EVENT_SIGNAL:
SDEI_LOG("> SIGNAL(e:%lx t:%lx)\n", x1, x2);
ret = sdei_signal(x1, x2);
SDEI_LOG("< SIGNAL:%ld\n", ret);
SMC_RET1(handle, ret);
break;
default:
/* Do nothing in default case */
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment