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
Sun May 23 23:04:25 UTC 2021


neels has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/24385/1

diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index c0d9e4d..f3b6c3a 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1643,19 +1643,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: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210523/0855e7fe/attachment.htm>


More information about the gerrit-log mailing list