From 76bfea7cf90daa09057c9d9e6a47fac29391dd28 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Thu, 15 Aug 2019 14:04:37 +0200 Subject: [PATCH] Bluetooth: controller: Ensure that a `case` statement is present When compiling a sample like a beacon, none of the `if defined()` statements in the switch case are actually compiled in, so the compiler complains of an orphan mem_release();break; sequence. Add a type that we know will always be compiled in in order to avoid this issue. Signed-off-by: Carles Cufi --- subsys/bluetooth/controller/ll_sw/ull.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/controller/ll_sw/ull.c b/subsys/bluetooth/controller/ll_sw/ull.c index a7ccd06cc22..752c2e36889 100644 --- a/subsys/bluetooth/controller/ll_sw/ull.c +++ b/subsys/bluetooth/controller/ll_sw/ull.c @@ -781,6 +781,11 @@ void ll_rx_mem_release(void **node_rx) case NODE_RX_TYPE_USER_START ... NODE_RX_TYPE_USER_END: #endif /* CONFIG_BT_CTLR_USER_EXT */ + /* Ensure that at least one 'case' statement is present for this + * code block. + */ + case NODE_RX_TYPE_NONE: + LL_ASSERT(rx_free->type != NODE_RX_TYPE_NONE); mem_release(rx_free, &mem_pdu_rx.free); break; @@ -803,7 +808,6 @@ void ll_rx_mem_release(void **node_rx) break; #endif /* CONFIG_BT_CONN */ - case NODE_RX_TYPE_NONE: case NODE_RX_TYPE_EVENT_DONE: default: LL_ASSERT(0);