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

Commit 032c7fa7 authored by Chris Manton's avatar Chris Manton
Browse files

Simplify return value btm_ble_read_resolving_list_entry

Return value too complicated.

Heck, it's not even checked in the single call location

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id08da2a6f2e16da18c12477b00b112c65ac02543
parent 98d7636d
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -466,12 +466,15 @@ void btm_ble_clear_resolving_list(void) {
 *
 * Parameters       entry index.
 *
 * Returns          status
 * Returns          true if command successfully sent, false otherwise
 *
 ******************************************************************************/
tBTM_STATUS btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) {
  if (!(p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT))
    return BTM_WRONG_MODE;
bool btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) {
  if (!(p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT)) {
    LOG_INFO("%s Unable to read resolving list entry as resolving bit not set",
             __func__);
    return false;
  }

  if (controller_get_interface()->supports_ble_privacy()) {
    btsnd_hcic_ble_read_resolvable_addr_peer(p_dev_rec->ble.identity_addr_type,
@@ -490,7 +493,7 @@ tBTM_STATUS btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec) {
  btm_ble_enq_resolving_list_pending(p_dev_rec->bd_addr,
                                     BTM_BLE_META_READ_IRK_ENTRY);

  return BTM_CMD_STARTED;
  return true;
}

/*******************************************************************************
+1 −2
Original line number Diff line number Diff line
@@ -122,8 +122,7 @@ extern void btm_read_local_name_complete(uint8_t* p, uint16_t evt_len);
extern void btm_ble_create_conn_cancel_complete(uint8_t* p);
extern bool btm_ble_addr_resolvable(const RawAddress& rpa,
                                    tBTM_SEC_DEV_REC* p_dev_rec);
extern tBTM_STATUS btm_ble_read_resolving_list_entry(
    tBTM_SEC_DEV_REC* p_dev_rec);
extern bool btm_ble_read_resolving_list_entry(tBTM_SEC_DEV_REC* p_dev_rec);
extern bool btm_ble_resolving_list_load_dev(tBTM_SEC_DEV_REC* p_dev_rec);
extern void btm_ble_resolving_list_remove_dev(tBTM_SEC_DEV_REC* p_dev_rec);