[MERGED] osmo-bsc[master]: HO: cosmetic: bsc_handover_start_lchan_change(): tweak local...

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
Fri Feb 16 15:37:13 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: HO: cosmetic: bsc_handover_start_lchan_change(): tweak local vars
......................................................................


HO: cosmetic: bsc_handover_start_lchan_change(): tweak local vars

To keep this cosmetic change apart from subsequent functional changes:
have a local do_assigment flag and a local network pointer.

Change-Id: I09684dcf2a00e3d930e058cc1c925ad6e59b1468
---
M src/libbsc/handover_logic.c
1 file changed, 11 insertions(+), 3 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index b7f350f..fad4a33 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -93,10 +93,12 @@
 int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts,
 		       enum gsm_chan_t new_lchan_type)
 {
+	struct gsm_network *network;
 	struct gsm_lchan *new_lchan;
 	struct bsc_handover *ho;
 	static uint8_t ho_ref = 0;
 	int rc;
+	bool do_assignment = false;
 
 	/* don't attempt multiple handovers for the same lchan at
 	 * the same time */
@@ -106,8 +108,14 @@
 	DEBUGP(DHO, "Beginning with handover operation"
 	       "(old_lchan on BTS %u, new BTS %u) ...\n",
 		old_lchan->ts->trx->bts->nr, new_bts->nr);
+	/* No new BTS? Then it shall be assignment within the same BTS. */
+	if (!new_bts)
+		new_bts = old_lchan->ts->trx->bts;
+	do_assignment = (new_bts == old_lchan->ts->trx->bts);
 
-	rate_ctr_inc(&new_bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]);
+	network = new_bts->network;
+
+	rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]);
 
 	if (!old_lchan->conn) {
 		LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n");
@@ -117,7 +125,7 @@
 	new_lchan = lchan_alloc(new_bts, new_lchan_type, 0);
 	if (!new_lchan) {
 		LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type));
-		rate_ctr_inc(&new_bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]);
+		rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]);
 		return -ENOSPC;
 	}
 
@@ -130,7 +138,7 @@
 	ho->old_lchan = old_lchan;
 	ho->new_lchan = new_lchan;
 	ho->ho_ref = ho_ref++;
-	if (old_lchan->ts->trx->bts != new_bts) {
+	if (!do_assignment) {
 		ho->inter_cell = true;
 		ho->async = true;
 	}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I09684dcf2a00e3d930e058cc1c925ad6e59b1468
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list