Change in osmo-bsc[master]: bty_vty: add VTY settungs for temporary overpower
gerrit-no-reply at lists.osmocom.org
Tue Aug 31 06:46:42 UTC 2021
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25283 )
Change subject: bty_vty: add VTY settungs for temporary overpower
Patch Set 1: Code-Review-1
PS1, Line 563: cap = (struct abis_rsl_osmo_top_acch_cap *)msg->tail;
I think this approach is rather weird.
a) we know that RSL_IE_OSMO_TOP_ACCH_CAP simply is a uint8_t and we don't use a struct, which means we can simply copy a uint8_t to the IE, or
b) we use an opaque structure, but then we should only copy structure to structure with a memcpy, rather than copying a uint8_t to the tlv, while using sizeof() of the struct.
To me, this looks like the absolute worst of both worlds.
The only advantage of introducing a struct with a single element is future extensibility, but that only makes sense if all of the code is written in a way that it does not contain any assumptions that the struct/IE only constists of a single element. Then you must write the code in a generic way.
By mixing the two approaches it looks like it is easy to extend the s truct with additional elements, but actually it still will not work if you extend.
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25283
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Comment-Date: Tue, 31 Aug 2021 06:46:42 +0000
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gerrit-log