Change in osmo-bsc[master]: cosmetic scoping in reuse_existing_lchan()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Thu May 27 15:01:58 UTC 2021


neels has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24351 )

Change subject: cosmetic scoping in reuse_existing_lchan()
......................................................................

cosmetic scoping in reuse_existing_lchan()

cosmetic prep for Ie0da36124d73efc28a8809b63d7c96e2167fc412

Related: SYS#5315 OS#4940
Change-Id: I0d1000cf108b0dfdc690f7a59d9bdf40de9043d2
---
M src/osmo-bsc/assignment_fsm.c
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index bfb4043..60e3342 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -430,11 +430,12 @@
 
 	/* Check if the currently existing lchan is compatible with the
 	 * preferred rate/codec. */
-	for (i = 0; i < req->n_ch_mode_rate; i++)
-		if (lchan_type_compat_with_mode(conn->lchan->type, &req->ch_mode_rate[i])) {
-			conn->lchan->ch_mode_rate = req->ch_mode_rate[i];
-			return true;
-		}
+	for (i = 0; i < req->n_ch_mode_rate; i++) {
+		if (!lchan_type_compat_with_mode(conn->lchan->type, &req->ch_mode_rate[i]))
+			continue;
+		conn->lchan->ch_mode_rate = req->ch_mode_rate[i];
+		return true;
+	}
 
 	return false;
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/24351
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I0d1000cf108b0dfdc690f7a59d9bdf40de9043d2
Gerrit-Change-Number: 24351
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210527/376162f7/attachment.htm>


More information about the gerrit-log mailing list