diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-12-03 19:28:02 +0100 |
---|---|---|
committer | Pau Espin Pedrol <pespin@espeweb.net> | 2020-12-04 14:44:43 +0100 |
commit | dd6af77e44a85702023f7faa7e361c800672a105 (patch) | |
tree | 050138bb99bf721055dd6ee50401e1c6965ef247 /src/osmo-bsc/abis_nm.c | |
parent | d74bb1e3b0473a13cbe70a20740a42837ffdd1a6 (diff) |
abis_nm: Simplify param passing to abis_nm_rx_get_attr_resp()
There's no real need to retrieve the trx before passing it to the
function, we can do that in the function itself and hence also simplify
the function itself.
Related: OS#4870
Change-Id: I7181510c5021ff2712c09ebc6ec8b13fdd8e8dc2
Diffstat (limited to 'src/osmo-bsc/abis_nm.c')
-rw-r--r-- | src/osmo-bsc/abis_nm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index b64b4dc97..9db49b711 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -669,15 +669,19 @@ static int parse_attr_resp_info(struct gsm_bts *bts, const struct gsm_bts_trx *t } /* Handle 3GPP TS 52.021 ยง8.11.3 Get Attribute Response */ -static int abis_nm_rx_get_attr_resp(struct msgb *mb, const struct gsm_bts_trx *trx) +static int abis_nm_rx_get_attr_resp(struct msgb *mb) { struct abis_om_hdr *oh = msgb_l2(mb); struct abis_om_fom_hdr *foh = msgb_l3(mb); struct e1inp_sign_link *sign_link = mb->dst; - struct gsm_bts *bts = trx ? trx->bts : sign_link->trx->bts; + struct gsm_bts *bts = sign_link->trx->bts; + const struct gsm_bts_trx *trx; struct tlv_parsed tp; int rc; + trx = foh->obj_class == NM_OC_BASEB_TRANSC ? + gsm_bts_trx_num(bts, foh->obj_inst.trx_nr) : NULL; + DEBUGPFOH(DNM, foh, "Get Attributes Response\n"); abis_nm_tlv_parse(&tp, bts, foh->data, oh->length-sizeof(*foh)); @@ -995,7 +999,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb) abis_nm_rx_set_bts_attr_ack(mb); break; case NM_MT_GET_ATTR_RESP: - ret = abis_nm_rx_get_attr_resp(mb, gsm_bts_trx_num(bts, (foh)->obj_inst.trx_nr)); + ret = abis_nm_rx_get_attr_resp(mb); break; case NM_MT_ESTABLISH_TEI_ACK: case NM_MT_CONN_TERR_SIGN_ACK: |