Neels Hofmeyr has uploaded this change for review. ( 
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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/11318/1

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: newchange
Gerrit-Change-Id: I6558a6948e8973cc91dae240375af074a5f5547e
Gerrit-Change-Number: 11318
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <[email protected]>

Reply via email to