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

Commit 80f0828d authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Simplify StackAclBtmAcl::btm_bda_to_acl am: 7af6f19a

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1448161

Change-Id: I2faf3cf4bac158baff419262060e9aee98bb6b4c
parents 9bd39680 7af6f19a
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;
}

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