fix(bt/bluedroid): fixed build error when compiler in performace mode

Closes https://github.com/espressif/esp-idf/issues/12751
This commit is contained in:
gongyantao 2023-12-11 12:04:09 +08:00
parent 9fe3bf2a3c
commit 264a743a7b
2 changed files with 16 additions and 3 deletions

View File

@ -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;

View File

@ -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;
}
@ -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;
}