laforge submitted this change.
pcu_info_update(): Simplify code path with early return
This makes it easy to add more checks, like done in a follow-up patch.
Change-Id: I694a0403e93af4435062f2b4534f84943007df87
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index d4eee44..83513f6 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -363,15 +363,16 @@
/* Allow test to overwrite it */
__attribute__((weak)) void pcu_info_update(struct gsm_bts *bts)
{
- if (pcu_connected(bts->network)) {
- if (bsc_co_located_pcu(bts)) {
- /* In cases where the CCU is connected via an E1 line, we transmit the connection parameters for the
- * PDCH before we announce the other BTS related parameters. */
- if (is_e1_bts(bts))
- pcu_tx_e1_ccu_ind(bts);
- pcu_tx_info_ind(bts);
- }
- }
+ if (!pcu_connected(bts->network))
+ return;
+ if (!bsc_co_located_pcu(bts))
+ return;
+
+ /* In cases where the CCU is connected via an E1 line, we transmit the connection parameters for the
+ * PDCH before we announce the other BTS related parameters. */
+ if (is_e1_bts(bts))
+ pcu_tx_e1_ccu_ind(bts);
+ pcu_tx_info_ind(bts);
}
static int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t sapi, uint32_t fn,
To view, visit change 38077. To unsubscribe, or for help writing mail filters, visit settings.