From c443888f3db896cc1a5c795e8a72c8ce8c21ac69 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 7 Jun 2016 13:25:15 +0200 Subject: [PATCH] Bluetooth: Simplify bt_hci_connect_le_cancel There is no need for local variabel as error code can be returned directly. Change-Id: I0ad1bccb75bf1897d210c12d3ad0108f1f909dbe Signed-off-by: Szymon Janc --- net/bluetooth/conn.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/net/bluetooth/conn.c b/net/bluetooth/conn.c index ebd07a4cf86..5c587077034 100644 --- a/net/bluetooth/conn.c +++ b/net/bluetooth/conn.c @@ -1265,8 +1265,6 @@ static int bt_hci_disconnect(struct bt_conn *conn, uint8_t reason) static int bt_hci_connect_le_cancel(struct bt_conn *conn) { - int err; - if (conn->timeout) { fiber_delayed_start_cancel(conn->timeout); conn->timeout = NULL; @@ -1275,12 +1273,7 @@ static int bt_hci_connect_le_cancel(struct bt_conn *conn) bt_conn_unref(conn); } - err = bt_hci_cmd_send(BT_HCI_OP_LE_CREATE_CONN_CANCEL, NULL); - if (err) { - return err; - } - - return 0; + return bt_hci_cmd_send(BT_HCI_OP_LE_CREATE_CONN_CANCEL, NULL); } int bt_conn_le_param_update(struct bt_conn *conn,