aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcommon/acc_ramp.c
diff options
context:
space:
mode:
authorStefan Sperling <ssperling@sysmocom.de>2018-02-06 18:03:12 +0100
committerStefan Sperling <ssperling@sysmocom.de>2018-02-06 18:03:12 +0100
commit7f117ae21c0a830dac04e062498d37b2cce8b64e (patch)
tree604f3d211dda7435e7acd2ecd83dd0c9fc7547f4 /src/libcommon/acc_ramp.c
parent00e3af8af7740d6f81694b991caaa0deb09925de (diff)
reformat loop for better readability
Diffstat (limited to 'src/libcommon/acc_ramp.c')
-rw-r--r--src/libcommon/acc_ramp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcommon/acc_ramp.c b/src/libcommon/acc_ramp.c
index ecfbc77fc..001a46fcb 100644
--- a/src/libcommon/acc_ramp.c
+++ b/src/libcommon/acc_ramp.c
@@ -87,7 +87,10 @@ static void do_ramping_step(void *data)
/* Allow 'step_size' ACCs, starting from ACC0. ACC9 will be allowed last. */
for (i = 0; i < acc_ramp->step_size; i++) {
int idx = ffs(acc_ramp->barred_t3);
- if (idx <= 0) {
+ if (idx > 0) {
+ /* one of ACC0-ACC7 is still bared */
+ allow_one_acc(acc_ramp, idx - 1);
+ } else {
idx = ffs(acc_ramp->barred_t2);
if (idx == 1 || idx == 2) {
/* ACC8 or ACC9 is still barred */
@@ -96,9 +99,6 @@ static void do_ramping_step(void *data)
/* all ACCs are now allowed */
break;
}
- } else {
- /* one of ACC0-ACC7 is still bared */
- allow_one_acc(acc_ramp, idx - 1);
}
}