aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-06-28 11:30:18 +0700
committerlaforge <laforge@osmocom.org>2020-06-29 08:51:11 +0000
commitb505ac38e7a1d050755f47180b2d6a8f7b72bce5 (patch)
tree599ad47866589f3c545f61e6f0e2ef9122fad046
parent842e4fab44434ef60b12f56d175fe5a13d7cd4bc (diff)
osmo-bts-trx/scheduler: cosmetic: move trx_if_powered() check
I believe the modern compilers are smart enough to optimize the outer (per-timeslot) loop of trx_sched_fn() in a way that TDMA frame number is advanced after making sure that a transceiver is powered on. However, it's still more perspicuous to check availability of a given transceiver first. Change-Id: I6a97000c1c84e36096e9ba378a489c82caa4cc5b
-rw-r--r--src/osmo-bts-trx/scheduler_trx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 6122ad08..472bae8b 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -73,14 +73,14 @@ static void trx_sched_fn(struct gsm_bts *bts, const uint32_t fn)
struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
struct l1sched_trx *l1t = &l1h->l1s;
- /* advance frame number, so the transceiver has more
- * time until it must be transmitted. */
- sched_fn = GSM_TDMA_FN_SUM(fn, plink->u.osmotrx.clock_advance);
-
/* we don't schedule, if power is off */
if (!trx_if_powered(l1h))
continue;
+ /* advance frame number, so the transceiver has more
+ * time until it must be transmitted. */
+ sched_fn = GSM_TDMA_FN_SUM(fn, plink->u.osmotrx.clock_advance);
+
/* process every TS of TRX */
for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) {
/* ready-to-send */