Change in osmo-pcu[master]: sched: Convert code handling next_list array to be size independant

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
Thu Dec 17 15:27:42 UTC 2020


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

Change subject: sched: Convert code handling next_list array to be size independant
......................................................................

sched: Convert code handling next_list array to be size independant

Change-Id: Id209fe66f85501437a79f7ca0c8e3cf816177611
---
M src/gprs_rlcmac_sched.cpp
1 file changed, 5 insertions(+), 6 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/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp
index 6505425..e6f7176 100644
--- a/src/gprs_rlcmac_sched.cpp
+++ b/src/gprs_rlcmac_sched.cpp
@@ -164,16 +164,16 @@
 {
 	struct msgb *msg = NULL;
 	struct gprs_rlcmac_tbf *tbf = NULL;
-	struct gprs_rlcmac_tbf *next_list[3] = { tbfs->ul_ass,
-						 tbfs->dl_ass,
-						 tbfs->ul_ack };
+	struct gprs_rlcmac_tbf *next_list[] = { tbfs->ul_ass,
+						tbfs->dl_ass,
+						tbfs->ul_ack };
 
 	/* Send Packet Application Information first (ETWS primary notifications) */
 	msg = sched_app_info(tbfs->dl_ass);
 
 	if (!msg) {
 		for (size_t i = 0; i < ARRAY_SIZE(next_list); ++i) {
-			tbf = next_list[(pdch->next_ctrl_prio + i) % 3];
+			tbf = next_list[(pdch->next_ctrl_prio + i) % ARRAY_SIZE(next_list)];
 			if (!tbf)
 				continue;
 
@@ -201,8 +201,7 @@
 				continue;
 			}
 
-			pdch->next_ctrl_prio += 1;
-			pdch->next_ctrl_prio %= 3;
+			pdch->next_ctrl_prio = (pdch->next_ctrl_prio + 1) % ARRAY_SIZE(next_list);
 			break;
 		}
 	}

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: Id209fe66f85501437a79f7ca0c8e3cf816177611
Gerrit-Change-Number: 21744
Gerrit-PatchSet: 2
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-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/20201217/f7935a1b/attachment.htm>


More information about the gerrit-log mailing list