Change in osmo-bts[master]: osmo-bts-trx/scheduler: cosmetic: move trx_if_powered() check

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/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Jun 29 08:51:11 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/19028 )

Change subject: osmo-bts-trx/scheduler: cosmetic: move trx_if_powered() check
......................................................................

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
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 6122ad0..472bae8 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -73,14 +73,14 @@
 		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 */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19028
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I6a97000c1c84e36096e9ba378a489c82caa4cc5b
Gerrit-Change-Number: 19028
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200629/5c84a123/attachment.htm>


More information about the gerrit-log mailing list