diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-10-10 16:36:39 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-10-12 06:26:10 +0000 |
commit | ffa49cfffd0a582002465e7605a7f14461432c33 (patch) | |
tree | 6e1de40a554fbccd95763d080b0e3f6e2265bbc1 | |
parent | d72c126f8bc6fd834a79e11a2bd87b5bbf50dbee (diff) |
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
-rw-r--r-- | src/osmo-bsc/handover_decision_2.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index fc94d6195..67ba26dd7 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -971,8 +971,10 @@ static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_r /* 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 @@ static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_r } /* 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 @@ static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_r /* 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; } |