aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-05-19 22:45:16 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-06-10 16:15:35 +0200
commit6ca1c28d9c88626b323b899e661915223563262a (patch)
treeb813f04bba314ad09d80dd2dcb57415e6524fc96
parent9de771724366fe776a89f420d360054aa5b6153c (diff)
get_any_lchan(): reduce minor code dup
-rw-r--r--src/osmo-bsc/abis_rsl.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index c430a1657..ac8006d33 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1701,19 +1701,12 @@ static struct gsm_lchan *get_any_lchan(struct gsm_bts *bts)
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;
}
}
}