laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/19509 )

Change subject: pcu_sock: use a 'switch' statement in ts_should_be_pdch()
......................................................................

pcu_sock: use a 'switch' statement in ts_should_be_pdch()

Change-Id: I628c2c5198c52fb82309dfe4a31a59aeebc00f09
---
M src/common/pcu_sock.c
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 8966b31..0125793 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -86,9 +86,10 @@

 static bool ts_should_be_pdch(const struct gsm_bts_trx_ts *ts)
 {
-       if (ts->pchan == GSM_PCHAN_PDCH)
+       switch (ts->pchan) {
+       case GSM_PCHAN_PDCH:
                return true;
-       if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
+       case GSM_PCHAN_TCH_F_PDCH:
                /* When we're busy deactivating the PDCH, we first set
                 * DEACT_PENDING, tell the PCU about it and wait for a
                 * response. So DEACT_PENDING means "no PDCH" to the PCU.
@@ -99,16 +100,16 @@
                        return !(ts->flags & TS_F_PDCH_DEACT_PENDING);
                else
                        return (ts->flags & TS_F_PDCH_ACT_PENDING);
-       }
-       if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
+       case GSM_PCHAN_TCH_F_TCH_H_PDCH:
                /*
                 * When we're busy de-/activating the PDCH, we first set
                 * ts->dyn.pchan_want, tell the PCU about it and wait for a
                 * response. So only care about dyn.pchan_want here.
                 */
                return ts->dyn.pchan_want == GSM_PCHAN_PDCH;
+       default:
+               return false;
        }
-       return false;
 }

 int pcu_tx_info_ind(void)

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/19509
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I628c2c5198c52fb82309dfe4a31a59aeebc00f09
Gerrit-Change-Number: 19509
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to