Skip to content

Commit cca0b79

Browse files
pabigotjhedberg
authored andcommitted
Bluetooth: host: fix warning on unused function
get_phy is referenced by BT_EXT_ADV only when BT_OBSERVER is also selected. Avoid defined-but-not-used warnings in that situation. Signed-off-by: Peter A. Bigot <[email protected]>
1 parent e5aaf21 commit cca0b79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,8 @@ static int hci_le_read_max_data_len(u16_t *tx_octets, u16_t *tx_time)
12611261
return 0;
12621262
}
12631263

1264-
#if defined(CONFIG_BT_EXT_ADV) || defined(CONFIG_BT_USER_PHY_UPDATE)
1264+
#if (defined(CONFIG_BT_OBSERVER) && defined(CONFIG_BT_EXT_ADV)) \
1265+
|| defined(CONFIG_BT_USER_PHY_UPDATE)
12651266
static u8_t get_phy(u8_t hci_phy)
12661267
{
12671268
switch (hci_phy) {
@@ -1275,7 +1276,7 @@ static u8_t get_phy(u8_t hci_phy)
12751276
return 0;
12761277
}
12771278
}
1278-
#endif /* defined(CONFIG_BT_EXT_ADV) || defined(CONFIG_BT_USER_PHY_UPDATE) */
1279+
#endif /* (BT_OBSERVER && BT_EXT_ADV) || USER_PHY_UPDATE */
12791280

12801281
#if defined(CONFIG_BT_CONN)
12811282
static void hci_acl(struct net_buf *buf)

0 commit comments

Comments
 (0)