Unverified Commit 3ed87a49 authored by Soby Mathew's avatar Soby Mathew Committed by GitHub
Browse files

Merge pull request #1584 from danielboulby-arm/db/Switches

Ensure the flow through switch statements is clear
parents a4277cda a08a2014
...@@ -86,11 +86,9 @@ register_t bl1_fwu_smc_handler(unsigned int smc_fid, ...@@ -86,11 +86,9 @@ register_t bl1_fwu_smc_handler(unsigned int smc_fid,
case FWU_SMC_UPDATE_DONE: case FWU_SMC_UPDATE_DONE:
bl1_fwu_done((void *)x1, NULL); bl1_fwu_done((void *)x1, NULL);
/* We should never return from bl1_fwu_done() */
break;
default: default:
assert(0); assert(0); /* Unreachable */
break; break;
} }
...@@ -732,7 +730,7 @@ static int bl1_fwu_image_reset(unsigned int image_id, unsigned int flags) ...@@ -732,7 +730,7 @@ static int bl1_fwu_image_reset(unsigned int image_id, unsigned int flags)
case IMAGE_STATE_EXECUTED: case IMAGE_STATE_EXECUTED:
default: default:
assert(0); assert(0); /* Unreachable */
break; break;
} }
......
...@@ -166,6 +166,7 @@ loop: ...@@ -166,6 +166,7 @@ loop:
padn = (padn * 10) + (ch - '0'); padn = (padn * 10) + (ch - '0');
fmt++; fmt++;
} }
assert(0); /* Unreachable */
default: default:
/* Exit on any other format specifier */ /* Exit on any other format specifier */
return -1; return -1;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <debug.h> #include <debug.h>
#include <platform.h> #include <platform.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -117,6 +118,7 @@ int snprintf(char *s, size_t n, const char *fmt, ...) ...@@ -117,6 +118,7 @@ int snprintf(char *s, size_t n, const char *fmt, ...)
ERROR("snprintf: specifier with ASCII code '%d' not supported.", ERROR("snprintf: specifier with ASCII code '%d' not supported.",
*fmt); *fmt);
plat_panic_handler(); plat_panic_handler();
assert(0); /* Unreachable */
} }
fmt++; fmt++;
continue; continue;
......
...@@ -226,7 +226,7 @@ void plat_ic_set_interrupt_type(unsigned int id, unsigned int type) ...@@ -226,7 +226,7 @@ void plat_ic_set_interrupt_type(unsigned int id, unsigned int type)
gicv2_type = GICV2_INTR_GROUP1; gicv2_type = GICV2_INTR_GROUP1;
break; break;
default: default:
assert(false); assert(0); /* Unreachable */
break; break;
} }
...@@ -266,7 +266,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode, ...@@ -266,7 +266,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode,
proc_num = -1; proc_num = -1;
break; break;
default: default:
assert(false); assert(0); /* Unreachable */
break; break;
} }
......
...@@ -157,6 +157,7 @@ uint32_t plat_interrupt_type_to_line(uint32_t type, ...@@ -157,6 +157,7 @@ uint32_t plat_interrupt_type_to_line(uint32_t type,
return __builtin_ctz(SCR_IRQ_BIT); return __builtin_ctz(SCR_IRQ_BIT);
else else
return __builtin_ctz(SCR_FIQ_BIT); return __builtin_ctz(SCR_FIQ_BIT);
assert(0); /* Unreachable */
case INTR_TYPE_NS: case INTR_TYPE_NS:
/* /*
* The Non secure interrupts will be signaled as FIQ in S-EL0/1 * The Non secure interrupts will be signaled as FIQ in S-EL0/1
...@@ -166,6 +167,7 @@ uint32_t plat_interrupt_type_to_line(uint32_t type, ...@@ -166,6 +167,7 @@ uint32_t plat_interrupt_type_to_line(uint32_t type,
return __builtin_ctz(SCR_FIQ_BIT); return __builtin_ctz(SCR_FIQ_BIT);
else else
return __builtin_ctz(SCR_IRQ_BIT); return __builtin_ctz(SCR_IRQ_BIT);
assert(0); /* Unreachable */
case INTR_TYPE_EL3: case INTR_TYPE_EL3:
/* /*
* The EL3 interrupts are signaled as FIQ in both S-EL0/1 and * The EL3 interrupts are signaled as FIQ in both S-EL0/1 and
...@@ -255,7 +257,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode, ...@@ -255,7 +257,7 @@ void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode,
irm = GICV3_IRM_ANY; irm = GICV3_IRM_ANY;
break; break;
default: default:
assert(false); assert(0); /* Unreachable */
break; break;
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <assert.h>
#include <cdefs.h> #include <cdefs.h>
#include <cdn_dp.h> #include <cdn_dp.h>
#include <smccc.h> #include <smccc.h>
...@@ -38,6 +39,7 @@ uint64_t dp_hdcp_ctrl(uint64_t type) ...@@ -38,6 +39,7 @@ uint64_t dp_hdcp_ctrl(uint64_t type)
return hdcp_handler(&key); return hdcp_handler(&key);
else else
return PSCI_E_INVALID_PARAMS; return PSCI_E_INVALID_PARAMS;
assert(0); /* Unreachable */
default: default:
return SMC_UNK; return SMC_UNK;
} }
......
...@@ -253,6 +253,7 @@ static enum pm_ret_status pm_ioctl_sd_dll_reset(enum pm_node_id nid, ...@@ -253,6 +253,7 @@ static enum pm_ret_status pm_ioctl_sd_dll_reset(enum pm_node_id nid,
if (type == PM_DLL_RESET_ASSERT) if (type == PM_DLL_RESET_ASSERT)
break; break;
mdelay(1); mdelay(1);
/* Fallthrough */
case PM_DLL_RESET_RELEASE: case PM_DLL_RESET_RELEASE:
ret = pm_mmio_write(ZYNQMP_SD_DLL_CTRL, mask, 0); ret = pm_mmio_write(ZYNQMP_SD_DLL_CTRL, mask, 0);
break; break;
......
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -48,7 +48,7 @@ uint64_t tlkd_va_translate(uintptr_t va, int type) ...@@ -48,7 +48,7 @@ uint64_t tlkd_va_translate(uintptr_t va, int type)
ats12e0w(va); ats12e0w(va);
break; break;
default: default:
assert(0); assert(0); /* Unreachable */
break; break;
} }
......
...@@ -592,6 +592,7 @@ static uintptr_t tspd_smc_handler(uint32_t smc_fid, ...@@ -592,6 +592,7 @@ static uintptr_t tspd_smc_handler(uint32_t smc_fid,
SMC_RET3(ns_cpu_context, x1, x2, x3); SMC_RET3(ns_cpu_context, x1, x2, x3);
} }
assert(0); /* Unreachable */
/* /*
* Request from the non-secure world to abort a preempted Yielding SMC * Request from the non-secure world to abort a preempted Yielding SMC
......
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