Change in osmocom-bb[master]: trxcon/scheduler: make TDMA_FN_INC(fn) behave like ++fn

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
Sun Mar 8 22:50:54 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/17349 )

Change subject: trxcon/scheduler: make TDMA_FN_INC(fn) behave like ++fn
......................................................................

trxcon/scheduler: make TDMA_FN_INC(fn) behave like ++fn

Change-Id: I9c2fa26df54b5de836a18f09363a9221c24ae707
---
M src/host/trxcon/sched_clck.c
M src/host/trxcon/sched_trx.c
M src/host/trxcon/scheduler.h
3 files changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/src/host/trxcon/sched_clck.c b/src/host/trxcon/sched_clck.c
index 66477b2..7c814dc 100644
--- a/src/host/trxcon/sched_clck.c
+++ b/src/host/trxcon/sched_clck.c
@@ -82,7 +82,7 @@
 		timespecadd(tv_clock, &frame_duration, tv_clock);
 		elapsed_us -= FRAME_DURATION_uS;
 
-		sched->fn_counter_proc = TDMA_FN_INC(sched->fn_counter_proc);
+		TDMA_FN_INC(&sched->fn_counter_proc);
 
 		/* Call frame callback */
 		if (sched->clock_cb)
@@ -178,7 +178,7 @@
 
 	/* Transmit what we still need to transmit */
 	while (fn != sched->fn_counter_proc) {
-		sched->fn_counter_proc = TDMA_FN_INC(sched->fn_counter_proc);
+		TDMA_FN_INC(&sched->fn_counter_proc);
 
 		/* Call frame callback */
 		if (sched->clock_cb)
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index 6bb662d..b7914b6 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -640,7 +640,7 @@
 	 * start counting from last fn + 1
 	 */
 	if (elapsed < 10)
-		fn = TDMA_FN_INC(ts->mf_last_fn);
+		fn = TDMA_FN_SUM(ts->mf_last_fn, 1);
 	else
 		fn = burst_fn;
 
@@ -682,7 +682,7 @@
 		if (fn == burst_fn)
 			break;
 
-		fn = TDMA_FN_INC(fn);
+		TDMA_FN_INC(&fn);
 	}
 
 	/* Set last processed frame number */
diff --git a/src/host/trxcon/scheduler.h b/src/host/trxcon/scheduler.h
index 7ab17ab..36c64e5 100644
--- a/src/host/trxcon/scheduler.h
+++ b/src/host/trxcon/scheduler.h
@@ -16,7 +16,7 @@
 #define TDMA_FN_SUB(a, b) \
 	((a + GSM_HYPERFRAME - b) % GSM_HYPERFRAME)
 #define TDMA_FN_INC(fn) \
-	TDMA_FN_SUM(fn, 1)
+	(*fn = TDMA_FN_SUM(*fn, 1))
 #define TDMA_FN_MIN(a, b) \
 	(a < b ? a : b)
 #define TDMA_FN_DIFF(a, b) \

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I9c2fa26df54b5de836a18f09363a9221c24ae707
Gerrit-Change-Number: 17349
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200308/fb91bada/attachment.htm>


More information about the gerrit-log mailing list