Change in osmo-bsc[master]: get_any_lchan(): reduce minor code dup

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 Jun 10 15:22:09 UTC 2021


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

Change subject: get_any_lchan(): reduce minor code dup
......................................................................

get_any_lchan(): reduce minor code dup

Change-Id: I304a7333adc265e156f04b42a10bac6912f58ad2
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 4 insertions(+), 11 deletions(-)

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



diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index c430a16..ac8006d 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1701,19 +1701,12 @@
 			ts = &trx->ts[ts_nr];
 			ts_for_n_lchans(lchan, ts, ts->max_primary_lchans) {
 				if (lchan->type == GSM_LCHAN_TCH_F || lchan->type == GSM_LCHAN_TCH_H) {
-					if (bts->chan_alloc_reverse) {
-						if (lchan->fi->state == LCHAN_ST_ESTABLISHED)
+					if (lchan->fi->state == LCHAN_ST_ESTABLISHED) {
+						if (!lchan_est || bts->chan_alloc_reverse)
 							lchan_est = lchan;
-						else
-							lchan_any = lchan;
 					} else {
-						if (lchan->fi->state == LCHAN_ST_ESTABLISHED) {
-							if (!lchan_est)
-								lchan_est = lchan;
-						} else {
-							if (!lchan_any)
-								lchan_any = lchan;
-						}
+						if (!lchan_any || bts->chan_alloc_reverse)
+							lchan_any = lchan;
 					}
 				}
 			}

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I304a7333adc265e156f04b42a10bac6912f58ad2
Gerrit-Change-Number: 24385
Gerrit-PatchSet: 29
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210610/e13f0ed7/attachment.htm>


More information about the gerrit-log mailing list