Change in libosmocore[master]: gsm: Deprecate buggy gsm_arfcn2band API and introduce gsm_arfcn2band_rc
Pau Espin Pedrol
gerrit-no-reply at lists.osmocom.org
Mon Nov 19 17:22:05 UTC 2018
Pau Espin Pedrol has posted comments on this change. ( https://gerrit.osmocom.org/11789 )
Change subject: gsm: Deprecate buggy gsm_arfcn2band API and introduce gsm_arfcn2band_rc
Patch Set 1:
> > 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
> 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 https://gerrit.osmocom.org/11789
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-CC: Max <msuraev at sysmocom.de>
Gerrit-Comment-Date: Mon, 19 Nov 2018 17:22:05 +0000
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gerrit-log