pespin has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/44/21744/1

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: 1
Gerrit-Owner: pespin <pes...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to