From 9331df16cf9241824dcef4e205456c274af3070e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 6 Jul 2016 14:38:20 +0200 Subject: [PATCH] cosmetic: dyn_pdch_init(): flatten if-logic, add comments Prepare for upcoming addition of heeding gprs mode == none. Change-Id: Id0fe6f762ac863c4d4053841c7732d011aa8c561 --- openbsc/src/libbsc/bsc_dyn_pdch.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c index 6e5fe8325..e0d1a6349 100644 --- a/openbsc/src/libbsc/bsc_dyn_pdch.c +++ b/openbsc/src/libbsc/bsc_dyn_pdch.c @@ -27,18 +27,18 @@ void dyn_pdch_init(struct gsm_bts_trx_ts *ts) { int rc; + /* Clear all dyn PDCH flags */ ts->flags &= ~(TS_F_PDCH_PENDING_MASK | TS_F_PDCH_ACTIVE); - if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) { - LOGP(DRSL, LOGL_DEBUG, "trying to PDCH ACT on" - " BTS %u TRX %u TS %u\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - rc = rsl_ipacc_pdch_activate(ts, 1); - if (rc != 0) { - LOGP(DRSL, LOGL_ERROR, - "Failed to activate PDCH on" - " BTS %u TRX %u TS %u: %d\n", - ts->trx->bts->nr, ts->trx->nr, ts->nr, rc); - } - } + /* Nothing to do if not a dynamic channel. */ + if (ts->pchan != GSM_PCHAN_TCH_F_PDCH) + return; + + LOGP(DRSL, LOGL_DEBUG, "%s %s: trying to PDCH ACT\n", + gsm_ts_name(ts), gsm_pchan_name(ts->pchan)); + + rc = rsl_ipacc_pdch_activate(ts, 1); + if (rc != 0) + LOGP(DRSL, LOGL_ERROR, "%s %s: PDCH ACT failed\n", + gsm_ts_name(ts), gsm_pchan_name(ts->pchan)); }