Skip to content

Commit

Permalink
fix(bt/bluedroid): fixed build error when compiler in performace mode
Browse files Browse the repository at this point in the history
Closes #12751
  • Loading branch information
ESP-YTGerd committed Dec 12, 2023
1 parent 9fe3bf2 commit 264a743
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 4 additions & 1 deletion components/bt/host/bluedroid/bta/hf_ag/bta_ag_sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,16 @@ void bta_ag_del_records(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
UNUSED(p_data);

/* get services of all other registered servers */
for (i = 0; i < BTA_AG_NUM_IDX; i++, p++) {
for (i = 0; i < BTA_AG_NUM_IDX; i++) {
if (p_scb == p) {
continue;
}
if (p->in_use && p->dealloc == FALSE) {
others |= p->reg_services;
}
if (i < BTA_AG_NUM_SCB) {
p++;
}
}
others >>= BTA_HSP_SERVICE_ID;
services = p_scb->reg_services >> BTA_HSP_SERVICE_ID;
Expand Down
14 changes: 12 additions & 2 deletions components/bt/host/bluedroid/bta/jv/bta_jv_act.c
Original file line number Diff line number Diff line change
Expand Up @@ -1248,10 +1248,15 @@ void bta_jv_delete_record(tBTA_JV_MSG *p_data)
*******************************************************************************/
static void bta_jv_l2cap_client_cback(UINT16 gap_handle, UINT16 event)
{
if (gap_handle >= BTA_JV_MAX_L2C_CONN) {
APPL_TRACE_WARNING("Invalid gap_handle: %u", gap_handle);
return;
}

tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data = {0};

if (gap_handle >= BTA_JV_MAX_L2C_CONN && !p_cb->p_cback) {
if (!p_cb->p_cback) {
return;
}

Expand Down Expand Up @@ -1402,12 +1407,17 @@ void bta_jv_l2cap_close(tBTA_JV_MSG *p_data)
*******************************************************************************/
static void bta_jv_l2cap_server_cback(UINT16 gap_handle, UINT16 event)
{
if (gap_handle >= BTA_JV_MAX_L2C_CONN) {
APPL_TRACE_WARNING("Invalid gap_handle: %u", gap_handle);
return;
}

tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data = {0};
tBTA_JV_L2CAP_CBACK *p_cback;
void *user_data;

if (gap_handle >= BTA_JV_MAX_L2C_CONN && !p_cb->p_cback) {
if (!p_cb->p_cback) {
return;
}

Expand Down

0 comments on commit 264a743

Please sign in to comment.