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

Commit 5f990598 authored by Mike J. Chen's avatar Mike J. Chen
Browse files

Change argument to return ptr rather than assign to unused local



There was a warning about local variable assigned but not used.
I believe this was actually an implementation and API problem.
The function is called "btm_sec_find_bonded_dev" and returns
a BOOLEAN about whether the search succeeded or not.  I believe
it should also return a pointer to the dev rec if the search
succeeded, but due to an API definition error, it was just
assigning a local rather than returning the pointer ot the rec.

Also add to btm_int.h a function prototype that was missing
and causing a warning about implicit declaration.

Change-Id: Ifcef3afe3acbe12f4c69472fcedd01b268f644dd
Signed-off-by: default avatarMike J. Chen <mjchen@google.com>
parent aa53cb97
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -939,6 +939,7 @@ extern void btm_clr_inq_db (BD_ADDR p_bda);
extern void         btm_inq_db_init (void);
extern void         btm_process_inq_results (UINT8 *p, UINT8 inq_res_mode);
extern void         btm_process_inq_complete (UINT8 status, UINT8 mode);
extern void         btm_process_cancel_complete(UINT8 status, UINT8 mode);
extern void         btm_event_filter_complete (UINT8 *p);
extern void         btm_inq_stop_on_ssp(void);
extern void         btm_inq_clear_ssp(void);
@@ -1123,7 +1124,7 @@ extern void btm_sec_dev_rec_cback_event (tBTM_SEC_DEV_REC *p_dev_rec, UINT8 res

#if BLE_INCLUDED == TRUE
extern void  btm_sec_clear_ble_keys (tBTM_SEC_DEV_REC  *p_dev_rec);
extern  BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC *p_rec);
extern  BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC **p_rec);
extern BOOLEAN btm_sec_is_a_bonded_dev (BD_ADDR bda);
extern BOOLEAN btm_sec_is_le_capable_dev (BD_ADDR bda);
#endif /* BLE_INCLUDED */
+2 −2
Original line number Diff line number Diff line
@@ -5772,7 +5772,7 @@ BOOLEAN btm_sec_is_le_capable_dev (BD_ADDR bda)
** Returns          TRUE - found a bonded device
**
*******************************************************************************/
BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC *p_rec)
BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC **p_rec)
{
    BOOLEAN found= FALSE;

@@ -5791,7 +5791,7 @@ BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_D
        if (p_dev_rec->ble.key_type || (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN))
        {
            *p_found_idx = i;
            p_rec = p_dev_rec;
            *p_rec = p_dev_rec;
            break;
        }
    }