diff options
author | Daniel Boulby <daniel.boulby@arm.com> | 2018-06-22 14:16:03 +0100 |
---|---|---|
committer | Daniel Boulby <daniel.boulby@arm.com> | 2018-09-21 13:14:13 +0100 |
commit | a08a2014300a495381cdb8f6d59523bcd5d3b883 (patch) | |
tree | ab016b027c303ccbe8001764f824f8980b233f54 /plat/rockchip/rk3399/drivers | |
parent | e52ed092cde21d13533df32eb68629a980d69b4b (diff) | |
download | trusted-firmware-a-a08a2014300a495381cdb8f6d59523bcd5d3b883.tar.gz |
Ensure the flow through switch statements is clear
Ensure case clauses:
* Terminate with an unconditional break, return or goto statement.
* Use conditional break, return or goto statements as long as the end
of the case clause is unreachable; such case clauses must terminate
with assert(0) /* Unreachable */ or an unconditional __dead2 function
call
* Only fallthough when doing otherwise would result in less
readable/maintainable code; such case clauses must terminate with a
/* Fallthrough */ comment to make it clear this is the case and
indicate that a fallthrough is intended.
This reduces the chance of bugs appearing due to unintended flow through a
switch statement
Change-Id: I70fc2d1f4fd679042397dec12fd1982976646168
Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Diffstat (limited to 'plat/rockchip/rk3399/drivers')
-rw-r--r-- | plat/rockchip/rk3399/drivers/dp/cdn_dp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c index 2adab8fbf8..73a75bb7c4 100644 --- a/plat/rockchip/rk3399/drivers/dp/cdn_dp.c +++ b/plat/rockchip/rk3399/drivers/dp/cdn_dp.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include <assert.h> #include <cdefs.h> #include <cdn_dp.h> #include <smccc.h> @@ -38,6 +39,7 @@ uint64_t dp_hdcp_ctrl(uint64_t type) return hdcp_handler(&key); else return PSCI_E_INVALID_PARAMS; + assert(0); /* Unreachable */ default: return SMC_UNK; } |