[PATCH] osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jan 28 02:24:27 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/5511

to look at the new patch set (#9).

remove obsolete gsm_subscriber_connection.bts member

This member was merely a cache for conn->lchan->ts->trx->bts,
so let's avoid having to keep copies of the same data (which needs
to be kept up to date).

Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_api.c
M src/libbsc/handover_logic.c
M tests/bsc/bsc_test.c
4 files changed, 5 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/5511/9

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index d9dd2d4..bdf7cfb 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -96,9 +96,6 @@
 	struct gsm_lchan *lchan;
 	/* the future/allocated but not yet used lchan during HANDOVER */
 	struct gsm_lchan *ho_lchan;
-	/* a short-hand pointer to the BTS currently serving the subscriber,
-	 * points to gsm_subscriber_connection.lchan->ts->trx->bts */
-	struct gsm_bts *bts;
 
 	/* timer for assignment handling */
 	struct osmo_timer_list T10;
@@ -116,13 +113,14 @@
 	struct llist_head ho_penalty_timers;
 };
 
-static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) {
-	return conn->bts;
-}
-
 
 #include "gsm_data_shared.h"
 
+static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) {
+	OSMO_ASSERT(conn->lchan);
+	return conn->lchan->ts->trx->bts;
+}
+
 enum {
 	BTS_CTR_CHREQ_TOTAL,
 	BTS_CTR_CHREQ_NO_CHANNEL,
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 27bf739..21836f3 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -274,7 +274,6 @@
 
 	conn->network = net;
 	conn->lchan = lchan;
-	conn->bts = lchan->ts->trx->bts;
 	lchan->conn = conn;
 	INIT_LLIST_HEAD(&conn->ho_dtap_cache);
 	INIT_LLIST_HEAD(&conn->ho_penalty_timers);
@@ -873,7 +872,6 @@
 	conn->lchan = NULL;
 	conn->secondary_lchan = NULL;
 	conn->ho_lchan = NULL;
-	conn->bts = NULL;
 
 	osmo_timer_del(&conn->T10);
 
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index 4b86de7..6eada5b 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -288,7 +288,6 @@
 
 	new_lchan->conn->ho_lchan = NULL;
 	new_lchan->conn->lchan = new_lchan;
-	new_lchan->conn->bts = new_lchan->ts->trx->bts;
 	ho->old_lchan->conn = NULL;
 
 	lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END);
diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c
index 1fb51aa..420ef73 100644
--- a/tests/bsc/bsc_test.c
+++ b/tests/bsc/bsc_test.c
@@ -134,7 +134,6 @@
 
 	bts->network = net;
 	sccp_con->msc = msc;
-	conn->bts = bts;
 	conn->sccp_con = sccp_con;
 	conn->lchan = &bts->c0->ts[1].lchan[0];
 

-- 
To view, visit https://gerrit.osmocom.org/5511
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0
Gerrit-PatchSet: 9
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list