[MERGED] openbsc[master]: cosmetic: dyn_pdch_init(): flatten if-logic, add comments

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Jul 17 07:46:39 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: dyn_pdch_init(): flatten if-logic, add comments
......................................................................


cosmetic: dyn_pdch_init(): flatten if-logic, add comments

Prepare for upcoming addition of heeding gprs mode == none.

Change-Id: Id0fe6f762ac863c4d4053841c7732d011aa8c561
---
M openbsc/src/libbsc/bsc_dyn_pdch.c
1 file changed, 12 insertions(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified
  Holger Freyther: Looks good to me, but someone else must approve



diff --git a/openbsc/src/libbsc/bsc_dyn_pdch.c b/openbsc/src/libbsc/bsc_dyn_pdch.c
index 6e5fe83..e0d1a63 100644
--- a/openbsc/src/libbsc/bsc_dyn_pdch.c
+++ b/openbsc/src/libbsc/bsc_dyn_pdch.c
@@ -27,18 +27,18 @@
 {
 	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));
 }

-- 
To view, visit https://gerrit.osmocom.org/496
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id0fe6f762ac863c4d4053841c7732d011aa8c561
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list