fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28664 )
Change subject: trxcon: cosmetic: use ARRAY_SIZE() whenever appropriate ......................................................................
trxcon: cosmetic: use ARRAY_SIZE() whenever appropriate
Change-Id: I2a246bad8d11ed45fbf849de961713ab96907d83 --- M src/host/trxcon/src/l1ctl.c M src/host/trxcon/src/sched_trx.c 2 files changed, 4 insertions(+), 4 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/host/trxcon/src/l1ctl.c b/src/host/trxcon/src/l1ctl.c index fb8a203..ef88cd9 100644 --- a/src/host/trxcon/src/l1ctl.c +++ b/src/host/trxcon/src/l1ctl.c @@ -765,7 +765,7 @@ "(tch_mode=%u, audio_mode=%u)\n", req->tch_mode, req->audio_mode);
/* Iterate over timeslot list */ - for (i = 0; i < TRX_TS_COUNT; i++) { + for (i = 0; i < ARRAY_SIZE(l1l->sched->ts); i++) { /* Timeslot is not allocated */ ts = l1l->sched->ts[i]; if (ts == NULL) diff --git a/src/host/trxcon/src/sched_trx.c b/src/host/trxcon/src/sched_trx.c index 556ebcc..964c72f 100644 --- a/src/host/trxcon/src/sched_trx.c +++ b/src/host/trxcon/src/sched_trx.c @@ -69,7 +69,7 @@ sched->fn_counter_advance);
/* Iterate over timeslot list */ - for (i = 0; i < TRX_TS_COUNT; i++) { + for (i = 0; i < ARRAY_SIZE(br); i++) { /* Initialize the buffer for this timeslot */ br[i] = (struct l1sched_burst_req) { .fn = fn, @@ -179,7 +179,7 @@ LOGP(DSCH, LOGL_NOTICE, "Shutdown scheduler\n");
/* Free all potentially allocated timeslots */ - for (i = 0; i < TRX_TS_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(sched->ts); i++) l1sched_del_ts(sched, i);
l1sched_clck_reset(sched); @@ -197,7 +197,7 @@ reset_clock ? "and clock counter" : "");
/* Free all potentially allocated timeslots */ - for (i = 0; i < TRX_TS_COUNT; i++) + for (i = 0; i < ARRAY_SIZE(sched->ts); i++) l1sched_del_ts(sched, i);
/* Stop and reset clock counter if required */