cosmetic: tighten function type signatures
* change return type to bool
* constify parameters
The nm_is_running(), trx_is_usable() and ts_is_usable() always return
boolean value and are always used as such anyway. The also do not change
their parameters.
Change-Id: I6a572fc78371c69f5308edbad0ebe15e143d0505
diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c
index f0275bc..4b2531e 100644
--- a/src/libbsc/chan_alloc.c
+++ b/src/libbsc/chan_alloc.c
@@ -36,41 +36,41 @@
#include <osmocom/core/talloc.h>
-static int ts_is_usable(struct gsm_bts_trx_ts *ts)
+static bool ts_is_usable(const struct gsm_bts_trx_ts *ts)
{
/* FIXME: How does this behave for BS-11 ? */
if (is_ipaccess_bts(ts->trx->bts)) {
if (!nm_is_running(&ts->mo.nm_state))
- return 0;
+ return false;
}
/* If a TCH/F_PDCH TS is busy changing, it is already taken or not
* yet available. */
if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
if (ts->flags & TS_F_PDCH_PENDING_MASK)
- return 0;
+ return false;
}
/* If a dynamic channel is busy changing, it is already taken or not
* yet available. */
if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
if (ts->dyn.pchan_is != ts->dyn.pchan_want)
- return 0;
+ return false;
}
- return 1;
+ return true;
}
-int trx_is_usable(struct gsm_bts_trx *trx)
+bool trx_is_usable(const struct gsm_bts_trx *trx)
{
/* FIXME: How does this behave for BS-11 ? */
if (is_ipaccess_bts(trx->bts)) {
if (!nm_is_running(&trx->mo.nm_state) ||
!nm_is_running(&trx->bb_transc.mo.nm_state))
- return 0;
+ return false;
}
- return 1;
+ return true;
}
static struct gsm_lchan *