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

Commit 478f0039 authored by Zach Johnson's avatar Zach Johnson
Browse files

p_switch_role_cb is never set to anything other than null

tetris combo + 1

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id99b76d882fd0de2dfb84e45adb8c896df4956f5
parent 65f25f01
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -340,16 +340,6 @@ void btm_acl_update_conn_addr(uint16_t conn_handle, const RawAddress& address) {
void btm_acl_report_role_change(uint8_t hci_status, const RawAddress* bda) {
  tBTM_ROLE_SWITCH_CMPL ref_data;
  BTM_TRACE_DEBUG("btm_acl_report_role_change");
  if (btm_cb.devcb.p_switch_role_cb &&
      (bda && btm_cb.devcb.switch_role_ref_data.remote_bd_addr == *bda)) {
    memcpy(&ref_data, &btm_cb.devcb.switch_role_ref_data,
           sizeof(tBTM_ROLE_SWITCH_CMPL));
    ref_data.hci_status = hci_status;
    (*btm_cb.devcb.p_switch_role_cb)(&ref_data);
    memset(&btm_cb.devcb.switch_role_ref_data, 0,
           sizeof(tBTM_ROLE_SWITCH_CMPL));
    btm_cb.devcb.p_switch_role_cb = NULL;
  }
}

/*******************************************************************************
@@ -493,9 +483,8 @@ tBTM_STATUS BTM_SwitchRole(const RawAddress& remote_bd_addr, uint8_t new_role) {
  tBTM_PM_MODE pwr_mode;
  tBTM_PM_PWR_MD settings;

  LOG_INFO("%s: peer %s new_role=0x%x p_switch_role_cb=%p", __func__,
           remote_bd_addr.ToString().c_str(), new_role,
           btm_cb.devcb.p_switch_role_cb);
  LOG_INFO("%s: peer %s new_role=0x%x", __func__,
           remote_bd_addr.ToString().c_str(), new_role);

  /* Make sure the local device supports switching */
  if (!controller_get_interface()->supports_master_slave_role_switch())
+0 −2
Original line number Diff line number Diff line
@@ -96,8 +96,6 @@ typedef struct {
                              /* read inq tx power function completes  */

  tBTM_ROLE_SWITCH_CMPL switch_role_ref_data;
  tBTM_CMPL_CB* p_switch_role_cb; /* Callback function to be called when  */
                                  /* requested switch role is completed   */

  alarm_t* read_tx_power_timer;     /* Read tx power timer */
  tBTM_CMPL_CB* p_tx_power_cmpl_cb; /* Callback function to be called       */