gsm_pchan2chan_nr(): Properly assert if unexpected pchan is passed

A bit of archeology, history & recap:
ec1b5a0e9e2b6549e0ede48e803095e569997355 (openbsc.git) Adds assert in gsm_ts2chan_nr()
2f44693fad8505255293d3ed37dbd4e7cabebd37 (openbsc.git) ASSERT is disabled due to reported hit in octphy and
						       litecell in gerrit for ec1b5a0e9e2b6549e0ede48e803095e569997355
5cef0623ef (osmo-bts,git) minor fixes to gsm_ts2chan_nr() regarding the pragma
c9079d9106 (osmo-bts.git) GSM_PCHAN_NONE case is introduced in gsm_ts2chan_nr()

This code has long evolved and robustness has improved, it's not even
part of openbsc.git for several years now. Let's always assert if we
receive an unexpected value there, since they are all internally handled
values and hence we have control over them.

Related: OS#2906
Change-Id: I25e2cf0c922bc9902336e9add75a47535b9355bf
This commit is contained in:
Pau Espin 2021-10-19 12:34:33 +02:00
parent 3b02b9ad53
commit d9079b192b
1 changed files with 1 additions and 8 deletions

View File

@ -364,14 +364,7 @@ static uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan,
default:
LOGP(DRSL, LOGL_ERROR, "Physical channel %s (0x%02x) not expected!\n",
gsm_pchan_name(pchan), (int)pchan);
/* OSMO_ASSERT(lchan_nr == 0);
* FIXME: On octphy and litecell, we hit above assertion (see
* Max's comment at https://gerrit.osmocom.org/589 ); disabled
* for BTS until this is clarified; remove the #ifdef when it
* is fixed. Tracked in OS#2906.
*/
#pragma message "fix caller that passes lchan_nr != 0"
cbits = 0x10;
OSMO_ASSERT(0);
break;
}