Skip to content

Commit a8f09a9

Browse files
committed
Bluetooth: BAP: BA: Fix sonarcloud issue with assignment and ++
Sonarcloud does not allow to use the result of a incremental (++) as an assignment. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 17383aa commit a8f09a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

subsys/bluetooth/audio/bap_broadcast_assistant.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,13 +706,14 @@ static uint8_t char_discover_func(struct bt_conn *conn,
706706
} else if (bt_uuid_cmp(chrc->uuid, BT_UUID_BASS_RECV_STATE) == 0) {
707707
if (inst->recv_state_cnt <
708708
CONFIG_BT_BAP_BROADCAST_ASSISTANT_RECV_STATE_COUNT) {
709-
uint8_t idx = inst->recv_state_cnt++;
709+
const uint8_t idx = inst->recv_state_cnt;
710710

711711
LOG_DBG("Receive State %u", inst->recv_state_cnt);
712712
inst->recv_state_handles[idx] =
713713
attr->handle + 1;
714714
sub_params = &inst->recv_state_sub_params[idx];
715715
sub_params->disc_params = &inst->recv_state_disc_params[idx];
716+
inst->recv_state_cnt++;
716717
}
717718
} else {
718719
LOG_DBG("Invalid UUID %s", bt_uuid_str(chrc->uuid));

0 commit comments

Comments
 (0)