Change in osmo-bsc[master]: rsl.c: Clean up some repeated use of long chains of pointers

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/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Oct 29 13:27:33 UTC 2019


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

Change subject: rsl.c: Clean up some repeated use of long chains of pointers
......................................................................

rsl.c: Clean up some repeated use of long chains of pointers

Further accesses will be addter in forthcoming commit, so let's first
store the pointers in variables to clean up the code.

Change-Id: Ie5ea0f44dfb5731cab7e8e5a3dd3d791ee703df7
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 9 insertions(+), 5 deletions(-)

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



diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 575f91d..6ffa415 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -295,12 +295,14 @@
 
 int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm)
 {
+	struct gsm_bts_trx *trx = lchan->ts->trx;
+	struct gsm_bts *bts = trx->bts;
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg;
 	uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
 	int ctl_lvl;
 
-	ctl_lvl = ms_pwr_ctl_lvl(lchan->ts->trx->bts->band, dbm);
+	ctl_lvl = ms_pwr_ctl_lvl(bts->band, dbm);
 	if (ctl_lvl < 0)
 		return ctl_lvl;
 
@@ -319,7 +321,7 @@
 	/* indicate MS power control to be performed by BTS: */
 	msgb_tl_put(msg, RSL_IE_MS_POWER_PARAM);
 
-	msg->dst = lchan->ts->trx->rsl_link;
+	msg->dst = trx->rsl_link;
 
 	return abis_rsl_sendmsg(msg);
 }
@@ -460,6 +462,8 @@
 /* Chapter 8.4.1 */
 int rsl_tx_chan_activ(struct gsm_lchan *lchan, uint8_t act_type, uint8_t ho_ref)
 {
+	struct gsm_bts_trx *trx = lchan->ts->trx;
+	struct gsm_bts *bts = trx->bts;
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg;
 	int rc;
@@ -487,7 +491,7 @@
 	ta = lchan->rqd_ta;
 
 	/* BS11 requires TA shifted by 2 bits */
-	if (lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11)
+	if (bts->type == GSM_BTS_TYPE_BS11)
 		ta <<= 2;
 
 	memset(&cd, 0, sizeof(cd));
@@ -548,9 +552,9 @@
 
 	mr_config_for_bts(lchan, msg);
 
-	msg->dst = lchan->ts->trx->rsl_link;
+	msg->dst = trx->rsl_link;
 
-	rate_ctr_inc(&lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_CHAN_ACT_TOTAL]);
+	rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHAN_ACT_TOTAL]);
 
 	return abis_rsl_sendmsg(msg);
 }

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie5ea0f44dfb5731cab7e8e5a3dd3d791ee703df7
Gerrit-Change-Number: 15890
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191029/8affbc11/attachment.htm>


More information about the gerrit-log mailing list