Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7af6f19a authored by Chris Manton's avatar Chris Manton
Browse files

Simplify StackAclBtmAcl::btm_bda_to_acl

Towards proper interfaces

Bug: 163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink

Change-Id: I6573f60cbf5e469fe780c6d5a4506c0dcd39f590
parent 1f985334
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -203,22 +203,20 @@ void BTM_acl_after_controller_started() {
 *                 (BR/EDR or LE)
 *
 * Returns         Returns pointer to the ACL DB for the requested BDA if found.
 *                 NULL if not found.
 *                 nullptr if not found.
 *
 ******************************************************************************/
tACL_CONN* StackAclBtmAcl::btm_bda_to_acl(const RawAddress& bda,
                                          tBT_TRANSPORT transport) {
  tACL_CONN* p = &btm_cb.acl_cb_.acl_db[0];
  uint16_t xx;
  for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p++) {
    if ((p->in_use) && p->remote_addr == bda && p->transport == transport) {
  tACL_CONN* p_acl = &btm_cb.acl_cb_.acl_db[0];
  for (uint8_t index = 0; index < MAX_L2CAP_LINKS; index++, p_acl++) {
    if ((p_acl->in_use) && p_acl->remote_addr == bda &&
        p_acl->transport == transport) {
      BTM_TRACE_DEBUG("btm_bda_to_acl found");
      return (p);
      return p_acl;
    }
  }

  /* If here, no BD Addr found */
  return ((tACL_CONN*)NULL);
  return nullptr;
}

/*******************************************************************************