aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-16 16:37:53 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2020-06-16 16:39:40 +0200
commitb56161f4e654af2c378d954666bf31b3b39b8a04 (patch)
tree03b17d9162f76b17c3b4686acd4f1b5bb63cbdc2
parent1e63317e29799432c8f055ae7e90f4148b07d48c (diff)
scheduler: _sched_dequeue_prim(): Refactor found_msg goto path
-rw-r--r--src/common/scheduler.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index ed7d4127..c1bd19f9 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -679,23 +679,20 @@ struct msgb *_sched_dequeue_prim(struct l1sched_trx *l1t, int8_t tn, uint32_t fn
return NULL;
/* l1sap_fn == fn */
- goto found_msg;
- }
-
- return NULL;
+ if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
+ || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
+ LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong chan_nr=0x%02x link_id=%02x, "
+ "expecting chan_nr=0x%02x link_id=%02x.\n", chan_nr, link_id,
+ trx_chan_desc[chan].chan_nr | tn, trx_chan_desc[chan].link_id);
+ goto free_msg;
+ }
-found_msg:
- if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
- || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
- LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong chan_nr=0x%02x link_id=%02x, "
- "expecting chan_nr=0x%02x link_id=%02x.\n", chan_nr, link_id,
- trx_chan_desc[chan].chan_nr | tn, trx_chan_desc[chan].link_id);
- goto free_msg;
+ /* unlink and return message */
+ llist_del(&msg->list);
+ return msg;
}
- /* unlink and return message */
- llist_del(&msg->list);
- return msg;
+ return NULL;
free_msg:
/* unlink and free message */