From debfbb69653421b523f50ef4625a4f7ee4741d5a Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sat, 17 Oct 2020 15:13:54 +0700 Subject: scheduler: join conditions in trx_sched_set_lchan() Change-Id: If2b68e3c7bf01badaaa4666198a4a4c5709f0040 --- src/common/scheduler.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 8cb9bd43..5bf1c5bc 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -1002,16 +1002,18 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i chan_state->ul_bursts = NULL; } - if (active) + if (active) { + /* Clean up everything */ memset(chan_state, 0, sizeof(*chan_state)); - else - chan_state->ho_rach_detect = 0; - chan_state->active = active; - if (active) { + /* Bind to generic 'struct gsm_lchan' */ chan_state->lchan = get_lchan_by_chan_nr(l1t->trx, chan_nr); OSMO_ASSERT(chan_state->lchan != NULL); + } else { + chan_state->ho_rach_detect = 0; } + + chan_state->active = active; } /* disable handover detection (on deactivation) */ -- cgit v1.2.3