From 3e2dc0d706716e414b886b2c470efadc136fa5c8 Mon Sep 17 00:00:00 2001 From: Vinayak Kariappa Chettimada Date: Tue, 29 Sep 2020 15:11:35 +0530 Subject: [PATCH] Bluetooth: controller: Add branch prediction hints Add branch prediction hints in critical control paths in the code. Signed-off-by: Vinayak Kariappa Chettimada --- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c | 2 +- subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c | 2 +- subsys/bluetooth/controller/ll_sw/ull_conn.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c index 44e5870aa79..9e78763cf7c 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c @@ -183,7 +183,7 @@ static int prepare_cb(struct lll_prepare_param *prepare_param) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (lll_is_stop(lll)) { + if (unlikely(lll_is_stop(lll))) { int err; err = lll_hfclock_off(); diff --git a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c index a120a92b446..33cc9ba181f 100644 --- a/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c +++ b/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_scan.c @@ -132,7 +132,7 @@ static int prepare_cb(struct lll_prepare_param *p) /* Check if stopped (on connection establishment race between LLL and * ULL. */ - if (lll_is_stop(lll)) { + if (unlikely(lll_is_stop(lll))) { int err; err = lll_hfclock_off(); diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn.c b/subsys/bluetooth/controller/ll_sw/ull_conn.c index a90e2496e4a..641fb0f98ff 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn.c +++ b/subsys/bluetooth/controller/ll_sw/ull_conn.c @@ -1009,7 +1009,7 @@ void ull_conn_done(struct node_rx_event_done *done) uint8_t force; /* Skip if connection terminated by local host */ - if (lll->handle == 0xFFFF) { + if (unlikely(lll->handle == 0xFFFF)) { return; }