From 96bc04f7ac0aa23e5a9dbb64d8ae5383e3923062 Mon Sep 17 00:00:00 2001 From: Lars Knudsen Date: Mon, 31 Jul 2023 14:36:28 +0200 Subject: [PATCH] shell: Fix faulty error check in bt shell bt_addr_le_to_str returns a length of bytes needed for string conversion, not an error code. Signed-off-by: Lars Knudsen --- subsys/bluetooth/shell/bt.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/subsys/bluetooth/shell/bt.c b/subsys/bluetooth/shell/bt.c index 37868e444dcb21..af17b3460b908c 100644 --- a/subsys/bluetooth/shell/bt.c +++ b/subsys/bluetooth/shell/bt.c @@ -361,13 +361,8 @@ bool passes_scan_filter(const struct bt_le_scan_recv_info *info, const struct ne if (scan_filter.addr_set) { char le_addr[BT_ADDR_LE_STR_LEN] = {0}; - int err; - err = bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); - if (err != 0) { - shell_error(ctx_shell, "Failed to convert addr to string: %d", err); - return false; - } + bt_addr_le_to_str(info->addr, le_addr, sizeof(le_addr)); if (!is_substring(scan_filter.addr, le_addr)) { return false;