refactor: warn against implicit fallthrough
Enable the `-Wimplicit-fallthrough` warning, which will warn if `case`
statements in a `switch` block fall through to the next `case`.
Intentional fallthrough can be signalled with the `[[fallthrough]]`
attribute which was added in C23.
Change-Id: I421cacadafba6457847c3a067483c97fdd9896cf
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/src/ffa/spmc/cpu_cycles.c b/src/ffa/spmc/cpu_cycles.c
index fd98edf..0b5809b 100644
--- a/src/ffa/spmc/cpu_cycles.c
+++ b/src/ffa/spmc/cpu_cycles.c
@@ -542,7 +542,7 @@
case FFA_MSG_SEND_DIRECT_REQ_64:
case FFA_MSG_SEND_DIRECT_REQ_32:
case FFA_MSG_SEND_DIRECT_REQ2_64:
- /* Fall through. */
+ [[fallthrough]];
case FFA_RUN_32: {
/* Rules 1,2 section 7.2 EAC0 spec. */
if (ffa_direct_msg_precedes_in_call_chain(current_locked,
@@ -603,7 +603,7 @@
case FFA_MSG_SEND_DIRECT_REQ_64:
case FFA_MSG_SEND_DIRECT_REQ_32:
case FFA_MSG_SEND_DIRECT_REQ2_64:
- /* Fall through. */
+ [[fallthrough]];
case FFA_RUN_32: {
/* Rules 1,2. */
if (ffa_direct_msg_precedes_in_call_chain(current_locked,
@@ -615,8 +615,8 @@
return true;
}
case FFA_MSG_SEND_DIRECT_RESP_64:
- case FFA_MSG_SEND_DIRECT_RESP_32: {
- case FFA_MSG_SEND_DIRECT_RESP2_64:
+ case FFA_MSG_SEND_DIRECT_RESP_32:
+ case FFA_MSG_SEND_DIRECT_RESP2_64: {
/* Rule 3. */
if (current_locked.vcpu->direct_request_origin.vm_id ==
receiver_vm_id) {