Commit 95d6058c authored by Gaetan Perrot's avatar Gaetan Perrot Committed by Benjamin Cabé
Browse files

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: default avatarGaetan Perrot <gaetan.perrot@spacecubics.com>
parent 2d388ba6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -759,7 +759,7 @@ static int gmap_ac_cap_unicast_start(const struct gmap_unicast_ac_param *param,
			 * location bit accordingly
			 */
			if (param->conn_cnt > 1U || param->snk_cnt[i] > 1U) {
				const int err = bt_audio_codec_cfg_set_chan_allocation(
				err = bt_audio_codec_cfg_set_chan_allocation(
					stream_param->codec_cfg, (enum bt_audio_location)BIT(i));

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

				if (err < 0) {