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/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20697 )
Change subject: scheduler: reduce nesting in trx_sched_set_lchan()
......................................................................
scheduler: reduce nesting in trx_sched_set_lchan()
Change-Id: I476dabb059325058a4327bb96430ce6ade199580
---
M src/common/scheduler.c
1 file changed, 30 insertions(+), 28 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/20697/1
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index ed41f9d..dedf096 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -981,36 +981,38 @@
/* look for all matching chan_nr/link_id */
for (i = 0; i < _TRX_CHAN_MAX; i++) {
- struct l1sched_chan_state *chan_state;
- chan_state = &l1ts->chan_state[i];
- if (trx_chan_desc[i].chan_nr == (chan_nr & RSL_CHAN_NR_MASK)
- && trx_chan_desc[i].link_id == link_id) {
- rc = 0;
- if (chan_state->active == active)
- continue;
- LOGP(DL1C, LOGL_NOTICE, "%s %s on trx=%d ts=%d\n",
- (active) ? "Activating" : "Deactivating",
- trx_chan_desc[i].name, l1t->trx->nr, tn);
- /* free burst memory, to cleanly start with burst 0 */
- if (chan_state->dl_bursts) {
- talloc_free(chan_state->dl_bursts);
- chan_state->dl_bursts = NULL;
- }
- if (chan_state->ul_bursts) {
- talloc_free(chan_state->ul_bursts);
- chan_state->ul_bursts = NULL;
- }
+ struct l1sched_chan_state *chan_state = &l1ts->chan_state[i];
- if (active)
- memset(chan_state, 0, sizeof(*chan_state));
- else
- chan_state->ho_rach_detect = 0;
- chan_state->active = active;
+ if (trx_chan_desc[i].chan_nr != (chan_nr & RSL_CHAN_NR_MASK))
+ continue;
+ if (trx_chan_desc[i].link_id != link_id)
+ continue;
- if (active) {
- chan_state->lchan = get_lchan_by_chan_nr(l1t->trx, chan_nr);
- OSMO_ASSERT(chan_state->lchan != NULL);
- }
+ rc = 0;
+ if (chan_state->active == active)
+ continue;
+ LOGP(DL1C, LOGL_NOTICE, "%s %s on trx=%d ts=%d\n",
+ (active) ? "Activating" : "Deactivating",
+ trx_chan_desc[i].name, l1t->trx->nr, tn);
+ /* free burst memory, to cleanly start with burst 0 */
+ if (chan_state->dl_bursts) {
+ talloc_free(chan_state->dl_bursts);
+ chan_state->dl_bursts = NULL;
+ }
+ if (chan_state->ul_bursts) {
+ talloc_free(chan_state->ul_bursts);
+ chan_state->ul_bursts = NULL;
+ }
+
+ if (active)
+ memset(chan_state, 0, sizeof(*chan_state));
+ else
+ chan_state->ho_rach_detect = 0;
+ chan_state->active = active;
+
+ if (active) {
+ chan_state->lchan = get_lchan_by_chan_nr(l1t->trx, chan_nr);
+ OSMO_ASSERT(chan_state->lchan != NULL);
}
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20697
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I476dabb059325058a4327bb96430ce6ade199580
Gerrit-Change-Number: 20697
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201017/c684c682/attachment.htm>