Change in osmo-bsc[master]: handover_decision_2.c: find_alternative_lchan: drop goto

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 Oct 12 06:26:11 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11318 )

Change subject: handover_decision_2.c: find_alternative_lchan: drop goto
......................................................................

handover_decision_2.c: find_alternative_lchan: drop goto

Don't goto the function end just to log something. Rather log right away and
exit early.

Change-Id: I6558a6948e8973cc91dae240375af074a5f5547e
---
M src/osmo-bsc/handover_decision_2.c
1 file changed, 9 insertions(+), 11 deletions(-)

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



diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index fc94d61..67ba26d 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -971,8 +971,10 @@
 
 	/* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies,
 	 * we may not even have any candidates. */
-	if (!candidates)
-		goto no_candidates;
+	if (!candidates) {
+		LOGPHOLCHAN(lchan, LOGL_INFO, "No viable neighbor cells found\n");
+		return 0;
+	}
 
 	/* select best candidate that fulfills requirement B: no congestion after HO */
 	best_better_db = 0;
@@ -1033,8 +1035,10 @@
 	}
 
 	/* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */
-	if (!include_weaker_rxlev)
-		goto no_candidates;
+	if (!include_weaker_rxlev) {
+		LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n");
+		return 0;
+	}
 
 	/* Select best candidate that fulfills requirement A: can service the call.
 	 * From above we know that there are no options that avoid congestion. Here we're trying to find
@@ -1069,13 +1073,7 @@
 
 	/* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec
 	 * restrictions or because all lchans are taken. */
-
-no_candidates:
-	if (include_weaker_rxlev)
-		LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n");
-	else
-		LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n");
-
+	LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n");
 	return 0;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/11318
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I6558a6948e8973cc91dae240375af074a5f5547e
Gerrit-Change-Number: 11318
Gerrit-PatchSet: 3
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181012/9b59c530/attachment.htm>


More information about the gerrit-log mailing list