Skip to content

Commit 95d6058

Browse files
moonlight83340kartben
authored andcommitted
tests: bsim: bluetooth: audio: Remove shadowed variable
Avoids shadowing the outer 'err' variable by reusing it instead of redeclaring a new one inside conditional blocks. This improves clarity and prevents confusion during debugging. Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
1 parent 2d388ba commit 95d6058

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/bsim/bluetooth/audio/src/gmap_ugg_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static int gmap_ac_cap_unicast_start(const struct gmap_unicast_ac_param *param,
759759
* location bit accordingly
760760
*/
761761
if (param->conn_cnt > 1U || param->snk_cnt[i] > 1U) {
762-
const int err = bt_audio_codec_cfg_set_chan_allocation(
762+
err = bt_audio_codec_cfg_set_chan_allocation(
763763
stream_param->codec_cfg, (enum bt_audio_location)BIT(i));
764764

765765
if (err < 0) {
@@ -785,7 +785,7 @@ static int gmap_ac_cap_unicast_start(const struct gmap_unicast_ac_param *param,
785785
* location bit accordingly
786786
*/
787787
if (param->conn_cnt > 1U || param->src_cnt[i] > 1U) {
788-
const int err = bt_audio_codec_cfg_set_chan_allocation(
788+
err = bt_audio_codec_cfg_set_chan_allocation(
789789
stream_param->codec_cfg, (enum bt_audio_location)BIT(i));
790790

791791
if (err < 0) {

0 commit comments

Comments
 (0)