fixeria has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/31948 )
Change subject: rlcmac: cosmetic: use ARRAY_SIZE() in handle_pkt_dl_ass() ......................................................................
rlcmac: cosmetic: use ARRAY_SIZE() in handle_pkt_dl_ass()
Change-Id: I98cff9c38ef8d44669ae233f2cf1c7d815e27ff8 --- M src/rlcmac/tbf_dl_ass_fsm.c 1 file changed, 10 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/src/rlcmac/tbf_dl_ass_fsm.c b/src/rlcmac/tbf_dl_ass_fsm.c index 9f13e75..74e1853 100644 --- a/src/rlcmac/tbf_dl_ass_fsm.c +++ b/src/rlcmac/tbf_dl_ass_fsm.c @@ -98,7 +98,6 @@ {
const Packet_Downlink_Assignment_t *dlass = &d->dl_block->u.Packet_Downlink_Assignment; - unsigned int i;
if (dlass->Exist_DOWNLINK_TFI_ASSIGNMENT) ctx->alloc.dl_tfi = dlass->DOWNLINK_TFI_ASSIGNMENT; @@ -110,7 +109,7 @@ ctx->tbf_starting_time = TBF_Starting_Frame_Number_to_fn(&dlass->TBF_Starting_Time, d->fn);
ctx->alloc.num_ts = 0; - for (i = 0; i < 8; i++) { + for (unsigned int i = 0; i < ARRAY_SIZE(ctx->alloc.ts); i++) { ctx->alloc.ts[i].allocated = (dlass->TIMESLOT_ALLOCATION >> i) & 0x01; if (ctx->alloc.ts[i].allocated) ctx->alloc.num_ts++;