Skip to content

Commit 17fc4b8

Browse files
alwa-nordicjhedberg
authored andcommitted
Bluetooth: Replace 'bt_addr_le_cmp(x) != 0' with 'bt_addr_le_eq(x)'
These should be equivalent. The '_eq'-form is more readable. Signed-off-by: Aleksander Wasaznik <[email protected]>
1 parent ea55818 commit 17fc4b8

File tree

2 files changed

+2
-2
lines changed
  • subsys/bluetooth/host
  • tests/bluetooth/tester/src

2 files changed

+2
-2
lines changed

subsys/bluetooth/host/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3944,7 +3944,7 @@ static uint8_t smp_ident_addr_info(struct bt_smp *smp, struct net_buf *buf)
39443944
return BT_SMP_ERR_INVALID_PARAMS;
39453945
}
39463946

3947-
if (bt_addr_le_cmp(&conn->le.dst, &req->addr) != 0) {
3947+
if (!bt_addr_le_eq(&conn->le.dst, &req->addr)) {
39483948
struct bt_keys *keys = bt_keys_find_addr(conn->id, &req->addr);
39493949

39503950
if (keys) {

tests/bluetooth/tester/src/gap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ static void connect(const uint8_t *data, uint16_t len)
813813
uint8_t status;
814814
int err;
815815

816-
if (bt_addr_le_cmp(addr, BT_ADDR_LE_ANY) != 0) {
816+
if (!bt_addr_le_eq(addr, BT_ADDR_LE_ANY)) {
817817
struct bt_conn *conn;
818818

819819
err = bt_conn_le_create(addr, BT_CONN_LE_CREATE_CONN,

0 commit comments

Comments
 (0)