Bluetooth: Remove unnecessary hci_explicit_connect_lookup function
authorJohan Hedberg <johan.hedberg@intel.com>
Wed, 21 Oct 2015 15:03:10 +0000 (18:03 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 21 Oct 2015 16:58:23 +0000 (18:58 +0200)
There's only one user of this helper which can be replaces with a call
to hci_pend_le_action_lookup() and a check for params->explicit_connect.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_core.c

index 32bb281e6aa6ed584f0adbcdf8eff71a43d9b007..1878d0a96333cef013fbad0b71defa0bb274d58b 100644 (file)
@@ -1042,9 +1042,6 @@ void hci_conn_params_clear_disabled(struct hci_dev *hdev);
 struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list,
                                                  bdaddr_t *addr,
                                                  u8 addr_type);
-struct hci_conn_params *hci_explicit_connect_lookup(struct hci_dev *hdev,
-                                                   bdaddr_t *addr,
-                                                   u8 addr_type);
 
 void hci_uuids_clear(struct hci_dev *hdev);
 
index 6ef1b4cc71a6b5d45a0b47e8671850046989271b..11316159a5a7bc08cc6098111bfc1ed7fcbc71b1 100644 (file)
@@ -83,8 +83,9 @@ static void hci_connect_le_scan_cleanup(struct hci_conn *conn)
                bdaddr_type = irk->addr_type;
        }
 
-       params = hci_explicit_connect_lookup(hdev, bdaddr, bdaddr_type);
-       if (!params)
+       params = hci_pend_le_action_lookup(&hdev->pend_le_conns, bdaddr,
+                                          bdaddr_type);
+       if (!params || !params->explicit_connect)
                return;
 
        /* The connection attempt was doing scan for new RPA, and is
index 964fba4c96bfa7944194463d6de50f82cfae86fe..086ed9389da1f961a78c5eafe1f47e4702ec0914 100644 (file)
@@ -2940,23 +2940,6 @@ struct hci_conn_params *hci_pend_le_action_lookup(struct list_head *list,
        return NULL;
 }
 
-/* This function requires the caller holds hdev->lock */
-struct hci_conn_params *hci_explicit_connect_lookup(struct hci_dev *hdev,
-                                                   bdaddr_t *addr,
-                                                   u8 addr_type)
-{
-       struct hci_conn_params *param;
-
-       list_for_each_entry(param, &hdev->pend_le_conns, action) {
-               if (bacmp(&param->addr, addr) == 0 &&
-                   param->addr_type == addr_type &&
-                   param->explicit_connect)
-                       return param;
-       }
-
-       return NULL;
-}
-
 /* This function requires the caller holds hdev->lock */
 struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
                                            bdaddr_t *addr, u8 addr_type)