laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38077?usp=email )
Change subject: pcu_info_update(): Simplify code path with early return ......................................................................
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(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
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,