osmo-pcu[master]: dl tbf: initialize punct values and verify

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Feb 9 12:38:45 UTC 2017


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/1775/1/src/tbf_dl.cpp
File src/tbf_dl.cpp:

Line 634: 	enum egprs_puncturing_values punct[2] = {
> Why hard coding of 2. Cant there be more blocks?
ARRAY_SIZE(rlc.block_info) always results in 2.

The call below to gprs_rlc_mcs_cps() also implies that punct has a length of two, since exactly the two array items are passed to the function.

Anything else than a size of two would frankly not make sense, and if someone changes the block_info size things would break silently before this patch.

This patch ensures that we will not miss this if the block_info size changes: the static assert below will highlight that something needs to be adjusted here.

Hence I fixate it on 2 and can use the inline initialization as above (without a for loop).


-- 
To view, visit https://gerrit.osmocom.org/1775
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I004cbbab15e6ffa2749f4b7f1df651517c2ae693
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: arvind.sirsikar <arvind.sirsikar at radisys.com>
Gerrit-HasComments: Yes


More information about the gerrit-log mailing list