From cb84ad1ad6de1e80227b984d656c783ace89e988 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sun, 27 Nov 2016 20:41:26 +0200 Subject: [PATCH] Bluetooth: Fix coding style issues in LE address helper functions Even one-line branches should have {}, and the last two return statements can be simplified into a single one. Change-Id: I0f65aeaba867240255eae8e1c461386700444ae6 Signed-off-by: Johan Hedberg --- subsys/bluetooth/host/hci_core.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 821d6ec5ea3..f4725c854ff 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -140,25 +140,21 @@ extern const struct bt_conn_auth_cb *bt_auth; static inline bool bt_addr_le_is_rpa(const bt_addr_le_t *addr) { - if (addr->type != BT_ADDR_LE_RANDOM) + if (addr->type != BT_ADDR_LE_RANDOM) { return false; + } - if ((addr->a.val[5] & 0xc0) == 0x40) - return true; - - return false; + return ((addr->a.val[5] & 0xc0) == 0x40); } static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr) { - if (addr->type == BT_ADDR_LE_PUBLIC) + if (addr->type == BT_ADDR_LE_PUBLIC) { return true; + } /* Check for Random Static address type */ - if ((addr->a.val[5] & 0xc0) == 0xc0) - return true; - - return false; + return ((addr->a.val[5] & 0xc0) == 0xc0); } static inline bool bt_le_conn_params_valid(uint16_t min, uint16_t max,