aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2012-08-24 15:08:23 +0200
committerHarald Welte <laforge@gnumonks.org>2012-08-29 16:33:53 +0200
commit9fc70f365ab372ed34655afd961a19cdfe5311ed (patch)
tree72820641d3bf14ed0968a24296864dea5e799db1
parent6fcac63cc059c3e114eed15772994a6eae31654e (diff)
bsc_api: Invert logic of chan_compat_with_mode()
A function called this way should return 1 if it is compatible, so something like "if (!chan_compat_with_mode())" will check if it is not compatible.
-rw-r--r--openbsc/src/libbsc/bsc_api.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index c00dc579c..f660be906 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -321,11 +321,11 @@ int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn,
static int chan_compat_with_mode(struct gsm_lchan *lchan, int chan_mode, int full_rate)
{
if (lchan->type == GSM_LCHAN_SDCCH)
- return 1;
+ return 0;
if (full_rate && lchan->type != GSM_LCHAN_TCH_F)
- return 1;
+ return 0;
- return 0;
+ return 1;
}
/**
@@ -341,7 +341,7 @@ int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, in
struct bsc_api *api;
api = conn->bts->network->bsc_api;
- if (chan_compat_with_mode(conn->lchan, chan_mode, full_rate) != 0) {
+ if (!chan_compat_with_mode(conn->lchan, chan_mode, full_rate)) {
if (handle_new_assignment(conn, chan_mode, full_rate) != 0)
goto error;
} else {