Change in osmo-bts[master]: Constify the 'trx' argument of trx_get_hlayer1() everywhere

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

fixeria gerrit-no-reply at lists.osmocom.org
Sun Aug 2 19:50:04 UTC 2020


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/19506 )


Change subject: Constify the 'trx' argument of trx_get_hlayer1() everywhere
......................................................................

Constify the 'trx' argument of trx_get_hlayer1() everywhere

Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
---
M src/common/pcu_sock.c
M src/osmo-bts-litecell15/l1_if.h
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-oc2g/l1_if.h
M src/osmo-bts-oc2g/oml.c
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-octphy/l1_oml.h
M src/osmo-bts-omldummy/bts_model.c
M src/osmo-bts-sysmo/l1_if.h
M src/osmo-bts-sysmo/oml.c
M src/osmo-bts-trx/main.c
M src/osmo-bts-virtual/main.c
M tests/stubs.c
13 files changed, 20 insertions(+), 20 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/06/19506/1

diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 5fa0e19..89fa01b 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -46,7 +46,7 @@
 #include <osmo-bts/l1sap.h>
 #include <osmo-bts/oml.h>
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx);
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx);
 
 extern struct gsm_network bts_gsmnet;
 int pcu_direct = 0;
diff --git a/src/osmo-bts-litecell15/l1_if.h b/src/osmo-bts-litecell15/l1_if.h
index f5efa91..655e63f 100644
--- a/src/osmo-bts-litecell15/l1_if.h
+++ b/src/osmo-bts-litecell15/l1_if.h
@@ -133,14 +133,14 @@
 int l1if_ms_pwr_ctrl(struct gsm_lchan *lchan, const int uplink_target,
 			const uint8_t ms_power, const float rxLevel);
 
-static inline struct lc15l1_hdl *trx_lc15l1_hdl(struct gsm_bts_trx *trx)
+static inline struct lc15l1_hdl *trx_lc15l1_hdl(const struct gsm_bts_trx *trx)
 {
-	struct phy_instance *pinst = trx_phy_instance(trx);
+	const struct phy_instance *pinst = trx_phy_instance(trx);
 	OSMO_ASSERT(pinst);
 	return pinst->u.lc15.hdl;
 }
 
-static inline struct gsm_bts_trx *lc15l1_hdl_trx(struct lc15l1_hdl *fl1h)
+static inline struct gsm_bts_trx *lc15l1_hdl_trx(const struct lc15l1_hdl *fl1h)
 {
 	OSMO_ASSERT(fl1h->phy_inst);
 	return fl1h->phy_inst->trx;
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 60fd1e7..f14f808 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -430,9 +430,9 @@
 	return l1if_gsm_req_compl(fl1h, msg, trx_init_compl_cb, NULL);
 }
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
-	struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(trx);
+	const struct lc15l1_hdl *fl1h = trx_lc15l1_hdl(trx);
 
 	return fl1h->hLayer1;
 }
diff --git a/src/osmo-bts-oc2g/l1_if.h b/src/osmo-bts-oc2g/l1_if.h
index e4b8feb..8e8a2ed 100644
--- a/src/osmo-bts-oc2g/l1_if.h
+++ b/src/osmo-bts-oc2g/l1_if.h
@@ -136,9 +136,9 @@
 int l1if_ms_pwr_ctrl(struct gsm_lchan *lchan, const int uplink_target,
 			const uint8_t ms_power, const float rxLevel);
 
-static inline struct oc2gl1_hdl *trx_oc2gl1_hdl(struct gsm_bts_trx *trx)
+static inline struct oc2gl1_hdl *trx_oc2gl1_hdl(const struct gsm_bts_trx *trx)
 {
-	struct phy_instance *pinst = trx_phy_instance(trx);
+	const struct phy_instance *pinst = trx_phy_instance(trx);
 	OSMO_ASSERT(pinst);
 	return pinst->u.oc2g.hdl;
 }
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 89ee0ac..f9faacf 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -446,9 +446,9 @@
 	return l1if_gsm_req_compl(fl1h, msg, trx_init_compl_cb, NULL);
 }
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
-	struct oc2gl1_hdl *fl1h = trx_oc2gl1_hdl(trx);
+	const struct oc2gl1_hdl *fl1h = trx_oc2gl1_hdl(trx);
 
 	return fl1h->hLayer1;
 }
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 8cc078e..300d618 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1426,7 +1426,7 @@
 }
 #endif
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx * trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
 	return 0;
 }
diff --git a/src/osmo-bts-octphy/l1_oml.h b/src/osmo-bts-octphy/l1_oml.h
index 4729df5..3c814c7 100644
--- a/src/osmo-bts-octphy/l1_oml.h
+++ b/src/osmo-bts-octphy/l1_oml.h
@@ -10,7 +10,7 @@
 
 int l1if_set_ciphering(struct gsm_lchan *lchan, int dir_downlink);
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx);
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx);
 
 int gsm_abis_mo_check_attr(const struct gsm_abis_mo *mo,
 			   const uint8_t * attr_ids, unsigned int num_attr_ids);
diff --git a/src/osmo-bts-omldummy/bts_model.c b/src/osmo-bts-omldummy/bts_model.c
index 1ff336e..3fd927d 100644
--- a/src/osmo-bts-omldummy/bts_model.c
+++ b/src/osmo-bts-omldummy/bts_model.c
@@ -169,7 +169,7 @@
 	return 0;
 }
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
 	return 0;
 }
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index 1b214be..8691eef 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -156,9 +156,9 @@
 int bts_check_for_ciph_cmd(struct femtol1_hdl *fl1h,
 			      struct msgb *msg, struct gsm_lchan *lchan);
 
-static inline struct femtol1_hdl *trx_femtol1_hdl(struct gsm_bts_trx *trx)
+static inline struct femtol1_hdl *trx_femtol1_hdl(const struct gsm_bts_trx *trx)
 {
-	struct phy_instance *pinst = trx_phy_instance(trx);
+	const struct phy_instance *pinst = trx_phy_instance(trx);
 	OSMO_ASSERT(pinst);
 	return pinst->u.sysmobts.hdl;
 }
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 57eab12..472a7ae 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -426,9 +426,9 @@
 	return l1if_gsm_req_compl(fl1h, msg, trx_init_compl_cb, NULL);
 }
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
-	struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx);
+	const struct femtol1_hdl *fl1h = trx_femtol1_hdl(trx);
 
 	return fl1h->hLayer1;
 }
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index d8cbbaa..e35f6fe 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -74,7 +74,7 @@
 };
 
 /* dummy, since no direct dsp support */
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
 	return 0;
 }
diff --git a/src/osmo-bts-virtual/main.c b/src/osmo-bts-virtual/main.c
index fb5d357..e5b7206 100644
--- a/src/osmo-bts-virtual/main.c
+++ b/src/osmo-bts-virtual/main.c
@@ -50,7 +50,7 @@
 #include "l1_if.h"
 
 /* dummy, since no direct dsp support */
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 {
 	return 0;
 }
diff --git a/tests/stubs.c b/tests/stubs.c
index 4663a44..b24dfc9 100644
--- a/tests/stubs.c
+++ b/tests/stubs.c
@@ -36,7 +36,7 @@
 __attribute__((weak)) int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
 { return 0; }
 
-uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx)
+uint32_t trx_get_hlayer1(const struct gsm_bts_trx *trx)
 { return 0; }
 
 __attribute__((weak)) int bts_model_oml_estab(struct gsm_bts *bts)

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19506
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I44523d26f2f564932ea95c17b1041d0ca9cc2828
Gerrit-Change-Number: 19506
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200802/19e18b52/attachment.htm>


More information about the gerrit-log mailing list