Change in osmo-bts[master]: bts-trx: sched_lchan_pdtch: Refactor tx_pdtch_fn to get rid of goto tag

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 Oct 25 15:57:24 UTC 2021


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

Change subject: bts-trx: sched_lchan_pdtch: Refactor tx_pdtch_fn to get rid of goto tag
......................................................................

bts-trx: sched_lchan_pdtch: Refactor tx_pdtch_fn to get rid of goto tag

With this change the error case is moved at the end of the function,
which is more usual. At the same time, one goto tag can be removed,
simplifying the function.

This is also a preparation for next patch improvinga bit the logic
around same place.

Related: SYS#5676
Related: SYS#4919
Change-Id: Ifbd95ccbebf4d810b1fe0a162722e63fe69106b8
---
M src/osmo-bts-trx/sched_lchan_pdtch.c
1 file changed, 11 insertions(+), 12 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index 17523e1..4c63acb 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -161,20 +161,11 @@
 
 	/* get mac block from queue */
 	msg = _sched_dequeue_prim(l1ts, br);
-	if (msg)
-		goto got_msg;
-
-	LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No prim for transmit.\n");
-
-no_msg:
-	/* free burst memory */
-	if (*bursts_p) {
-		talloc_free(*bursts_p);
-		*bursts_p = NULL;
+	if (!msg) {
+		LOGL1SB(DL1P, LOGL_INFO, l1ts, br, "No prim for transmit.\n");
+		goto no_msg;
 	}
-	return -ENODEV;
 
-got_msg:
 	/* BURST BYPASS */
 
 	/* allocate burst memory, if not already */
@@ -229,4 +220,12 @@
 	LOGL1SB(DL1P, LOGL_DEBUG, l1ts, br, "Transmitting burst=%u.\n", br->bid);
 
 	return 0;
+
+no_msg:
+	/* free burst memory */
+	if (*bursts_p) {
+		talloc_free(*bursts_p);
+		*bursts_p = NULL;
+	}
+	return -ENODEV;
 }

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ifbd95ccbebf4d810b1fe0a162722e63fe69106b8
Gerrit-Change-Number: 25941
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
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/20211025/a10e58e3/attachment.htm>


More information about the gerrit-log mailing list