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

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
Wed Jun 17 13:32:51 UTC 2020


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

Change subject: scheduler: _sched_dequeue_prim(): Refactor found_msg goto path
......................................................................

scheduler: _sched_dequeue_prim(): Refactor found_msg goto path

Change-Id: Icf7414d9fb17bbc3eb384329f587b3042ba0fcd5
---
M src/common/scheduler.c
1 file changed, 11 insertions(+), 14 deletions(-)

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



diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index ed7d412..c1bd19f 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -679,24 +679,21 @@
 			return NULL;
 
 		/* l1sap_fn == fn */
-		goto found_msg;
+		if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
+		 || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
+			LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong chan_nr=0x%02x link_id=%02x, "
+				"expecting chan_nr=0x%02x link_id=%02x.\n", chan_nr, link_id,
+				trx_chan_desc[chan].chan_nr | tn, trx_chan_desc[chan].link_id);
+			goto free_msg;
+		}
+
+		/* unlink and return message */
+		llist_del(&msg->list);
+		return msg;
 	}
 
 	return NULL;
 
-found_msg:
-	if ((chan_nr ^ (trx_chan_desc[chan].chan_nr | tn))
-	 || ((link_id & 0xc0) ^ trx_chan_desc[chan].link_id)) {
-		LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn, "Prim has wrong chan_nr=0x%02x link_id=%02x, "
-			"expecting chan_nr=0x%02x link_id=%02x.\n", chan_nr, link_id,
-			trx_chan_desc[chan].chan_nr | tn, trx_chan_desc[chan].link_id);
-		goto free_msg;
-	}
-
-	/* unlink and return message */
-	llist_del(&msg->list);
-	return msg;
-
 free_msg:
 	/* unlink and free message */
 	llist_del(&msg->list);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Icf7414d9fb17bbc3eb384329f587b3042ba0fcd5
Gerrit-Change-Number: 18861
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200617/b5f3d1ee/attachment.htm>


More information about the gerrit-log mailing list