Change in libosmocore[master]: gsm: Deprecate buggy gsm_arfcn2band API and introduce gsm_arfcn2band_rc

Pau Espin Pedrol gerrit-no-reply at
Mon Nov 19 17:22:05 UTC 2018

Pau Espin Pedrol has posted comments on this change. ( )

Change subject: gsm: Deprecate buggy gsm_arfcn2band API and introduce gsm_arfcn2band_rc

Patch Set 1:

> Hi,
 > > I could change the commit to name the new API
 > > "gsm_arfcn2band_validate", or actually use
 > > "osmo_gsm_arfcn2band".
 > A possible way to go is to introduce the new osmo_gsm_arfcn2band(),
 > introduce GSM_BAND_INVAL = 0x00, and return GSM_BAND_INVAL for 'out
 > of band' values from there.
 > The old gsm_arfcn2band() could then just call osmo_gsm_arfcn2band(),
 > and replace GSM_BAND_INVAL by GSM_BAND_1800. And of course, it
 > would
 > be marked as deprecated. What do you think?

No, I want old API (deprecated in this commit) to really stop returning wrong band from invalid arfcn, so we can really spot messy places (I did that, it was the way to find out some code using that function was wrong in osmo-bsc and doing unexpected stuff which was difficult to spot).

And as discussed here and on IRC, I'm also reluctant to add a new GSM_BAND_INVAL value which is really only be used here, and then we need to adapt all switch cases to handle this case which actually should never happen with the new API (because it returns an error). Let's not add this kind of hacks like adding an enum value to indicate error and better decouple correct values and error codes when input of a function is wrong.

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I780d452dcebce385469e32ef2fd844df6033393a
Gerrit-Change-Number: 11789
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: Harald Welte <laforge at>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at>
Gerrit-CC: Max <msuraev at>
Gerrit-Comment-Date: Mon, 19 Nov 2018 17:22:05 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list