Change in osmo-bts[master]: scheduler: _sched_dequeue_prim(): Refactor goto paths

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

pespin gerrit-no-reply at lists.osmocom.org
Tue Jun 16 14:48:22 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/18860 )


Change subject: scheduler: _sched_dequeue_prim(): Refactor goto paths
......................................................................

scheduler: _sched_dequeue_prim(): Refactor goto paths

Change-Id: Ia0b1674ac3dfbe89c9eb0e6d6426848ec64320d9
---
M src/common/scheduler.c
1 file changed, 9 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/18860/1

diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 86978eb..ed7d412 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -643,13 +643,8 @@
 	llist_for_each_entry_safe(msg, msg2, &l1ts->dl_prims, list) {
 		l1sap = msgb_l1sap_prim(msg);
 		if (l1sap->oph.operation != PRIM_OP_REQUEST) {
-wrong_type:
 			LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong type.\n");
-free_msg:
-			/* unlink and free message */
-			llist_del(&msg->list);
-			msgb_free(msg);
-			return NULL;
+			goto free_msg;
 		}
 		switch (l1sap->oph.primitive) {
 		case PRIM_PH_DATA:
@@ -663,7 +658,8 @@
 			l1sap_fn = l1sap->u.tch.fn;
 			break;
 		default:
-			goto wrong_type;
+			LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong type.\n");
+			goto free_msg;
 		}
 		prim_fn = ((l1sap_fn + GSM_HYPERFRAME - fn) % GSM_HYPERFRAME);
 		if (prim_fn > 100) { /* l1sap_fn < fn */
@@ -700,6 +696,12 @@
 	/* unlink and return message */
 	llist_del(&msg->list);
 	return msg;
+
+free_msg:
+	/* unlink and free message */
+	llist_del(&msg->list);
+	msgb_free(msg);
+	return NULL;
 }
 
 int _sched_compose_ph_data_ind(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ia0b1674ac3dfbe89c9eb0e6d6426848ec64320d9
Gerrit-Change-Number: 18860
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200616/7daa90b1/attachment.htm>


More information about the gerrit-log mailing list