From 9fc70f365ab372ed34655afd961a19cdfe5311ed Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 24 Aug 2012 15:08:23 +0200 Subject: 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. --- openbsc/src/libbsc/bsc_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'openbsc/src/libbsc/bsc_api.c') 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 { -- cgit v1.2.3