bluetooth: host: conn.c fix Constant variable guards dead code issue
This commit replaces the assignment of IS_ENABLED(x) macros to various variables with direct condition checking. This should fix the coverity issue and also promotes more uniformity in code. Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
parent
d1bd45739a
commit
1d7826c2ad
1 changed files with 2 additions and 5 deletions
|
@ -1721,15 +1721,12 @@ static bool can_initiate_feature_exchange(struct bt_conn *conn)
|
|||
* controller, as we know at compile time whether it supports or not
|
||||
* peripheral feature exchange.
|
||||
*/
|
||||
bool onboard_controller = IS_ENABLED(CONFIG_HAS_BT_CTLR);
|
||||
bool supports_peripheral_feature_exchange = IS_ENABLED(CONFIG_BT_CTLR_PER_INIT_FEAT_XCHG);
|
||||
bool is_central = IS_ENABLED(CONFIG_BT_CENTRAL) && conn->role == BT_HCI_ROLE_CENTRAL;
|
||||
|
||||
if (is_central) {
|
||||
if (IS_ENABLED(CONFIG_BT_CENTRAL) && (conn->role == BT_HCI_ROLE_CENTRAL)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (onboard_controller && supports_peripheral_feature_exchange) {
|
||||
if (IS_ENABLED(CONFIG_HAS_BT_CTLR) && IS_ENABLED(CONFIG_BT_CTLR_PER_INIT_FEAT_XCHG)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue