From 6ca0a4329437967e246b2e57c1004651ae8c2ac2 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 24 Nov 2022 17:09:03 +0100 Subject: [PATCH] gsm: constify several readonly params Change-Id: Ib11bfe57f546a5618f70152b9b75115808e54bf6 --- include/osmocom/gsm/gsm0502.h | 4 ++-- include/osmocom/gsm/gsm48.h | 2 +- src/gsm/gsm0502.c | 2 +- src/gsm/gsm48.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/osmocom/gsm/gsm0502.h b/include/osmocom/gsm/gsm0502.h index b6a18077f..8a8e51a51 100644 --- a/include/osmocom/gsm/gsm0502.h +++ b/include/osmocom/gsm/gsm0502.h @@ -33,7 +33,7 @@ /* Table 5 Clause 7 TS 05.02 */ static inline unsigned int -gsm0502_get_n_pag_blocks(struct gsm48_control_channel_descr *chan_desc) +gsm0502_get_n_pag_blocks(const struct gsm48_control_channel_descr *chan_desc) { if (chan_desc->ccch_conf == RSL_BCCH_CCCH_CONF_1_C) return 3 - chan_desc->bs_ag_blks_res; @@ -58,7 +58,7 @@ gsm0502_get_paging_group(uint64_t imsi, unsigned int bs_cc_chans, } unsigned int -gsm0502_calc_paging_group(struct gsm48_control_channel_descr *chan_desc, uint64_t imsi); +gsm0502_calc_paging_group(const struct gsm48_control_channel_descr *chan_desc, uint64_t imsi); enum gsm0502_fn_remap_channel { FN_REMAP_TCH_F, diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index c1ca63085..2a93c5e97 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -106,7 +106,7 @@ void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_encode_ra() instead"); bool gsm48_ra_equal(const struct gprs_ra_id *raid1, const struct gprs_ra_id *raid2); -int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); +int gsm48_number_of_paging_subchannels(const struct gsm48_control_channel_descr *chan_desc); void gsm48_mcc_mnc_to_bcd(uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc) OSMO_DEPRECATED("Use osmo_plmn_to_bcd() instead, to not lose leading zeros in the MNC"); diff --git a/src/gsm/gsm0502.c b/src/gsm/gsm0502.c index 94db94ee3..b14740614 100644 --- a/src/gsm/gsm0502.c +++ b/src/gsm/gsm0502.c @@ -34,7 +34,7 @@ #include unsigned int -gsm0502_calc_paging_group(struct gsm48_control_channel_descr *chan_desc, uint64_t imsi) +gsm0502_calc_paging_group(const struct gsm48_control_channel_descr *chan_desc, uint64_t imsi) { int ccch_conf; int bs_cc_chans; diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 30bba919e..c5fe55004 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -1361,7 +1361,7 @@ bool gsm48_ra_equal(const struct gprs_ra_id *raid1, const struct gprs_ra_id *rai * Uses From Table 10.5.33 of GSM 04.08 to determine the number of * paging sub-channels in the given control channel configuration */ -int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc) +int gsm48_number_of_paging_subchannels(const struct gsm48_control_channel_descr *chan_desc) { unsigned int n_pag_blocks = gsm0502_get_n_pag_blocks(chan_desc);