From 32e6347f426e3a860d1b88ae9a3e6d1e0eedf6ea Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 19 May 2020 17:09:14 +0800 Subject: [PATCH] Bluetooth: host: foreach bond only SMP is enabled build breakage if SMP is disabled In function `bt_unpair': bluetooth/host/hci_core.c:2640: undefined reference to `bt_foreach_bond' Signed-off-by: chao an --- subsys/bluetooth/host/hci_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 897d4ada85c..f1d0dd16548 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -2636,7 +2636,8 @@ int bt_unpair(u8_t id, const bt_addr_le_t *addr) return -EINVAL; } - if (!addr || !bt_addr_le_cmp(addr, BT_ADDR_LE_ANY)) { + if (IS_ENABLED(CONFIG_BT_SMP) && + (!addr || !bt_addr_le_cmp(addr, BT_ADDR_LE_ANY))) { bt_foreach_bond(id, unpair_remote, &id); return 0; }