From d7323d6f1f78ec1bd4c2838257395d47e54e932a Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 21 May 2021 19:59:00 +0200 Subject: [VAMOS] common: make 'struct gsm_bts_trx_ts' pointers const Change-Id: I0369ef4ae603a4afed0661a5894df6a7135b1919 --- include/osmo-bts/gsm_data.h | 6 +++--- src/common/gsm_data.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index be180075..50ee88ea 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -526,9 +526,9 @@ uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts); struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, int *rc); -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); -bool ts_is_tch(struct gsm_bts_trx_ts *ts); +enum gsm_phys_chan_config ts_pchan(const struct gsm_bts_trx_ts *ts); +uint8_t ts_subslots(const struct gsm_bts_trx_ts *ts); +bool ts_is_tch(const struct gsm_bts_trx_ts *ts); int lchan2ecu_codec(const struct gsm_lchan *lchan); diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c index 7cf48bfd..f1097225 100644 --- a/src/common/gsm_data.c +++ b/src/common/gsm_data.c @@ -352,7 +352,7 @@ static const uint8_t subslots_per_pchan[] = { }; /*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) +enum gsm_phys_chan_config ts_pchan(const struct gsm_bts_trx_ts *ts) { switch (ts->pchan) { case GSM_PCHAN_TCH_F_TCH_H_PDCH: @@ -369,7 +369,7 @@ enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) /*! According to ts->pchan and possibly ts->dyn_pchan, return the number of * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) +uint8_t ts_subslots(const struct gsm_bts_trx_ts *ts) { return subslots_per_pchan[ts_pchan(ts)]; } @@ -385,7 +385,7 @@ static bool pchan_is_tch(enum gsm_phys_chan_config pchan) } } -bool ts_is_tch(struct gsm_bts_trx_ts *ts) +bool ts_is_tch(const struct gsm_bts_trx_ts *ts) { return pchan_is_tch(ts_pchan(ts)); } @@ -403,7 +403,7 @@ const struct value_string lchan_ciph_state_names[] = { /* determine the ECU codec constant for the codec used by given lchan */ int lchan2ecu_codec(const struct gsm_lchan *lchan) { - struct gsm_bts_trx_ts *ts = lchan->ts; + const struct gsm_bts_trx_ts *ts = lchan->ts; switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_V1: -- cgit v1.2.3