Change in osmo-bsc[master]: abis_rsl: do not pass lchan to print_meas_rep_buf()

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

fixeria gerrit-no-reply at lists.osmocom.org
Mon Nov 8 16:53:00 UTC 2021


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

Change subject: abis_rsl: do not pass lchan to print_meas_rep_buf()
......................................................................

abis_rsl: do not pass lchan to print_meas_rep_buf()

Change-Id: If965c7dc6b989ee758ddec0190ec1cce8363b240
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 11 insertions(+), 16 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  neels: Looks good to me, approved



diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index cdd57c2..f849d27 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1177,21 +1177,11 @@
 			   prefix, mru->full.rx_qual, prefix, mru->sub.rx_qual);
 }
 
-static int print_meas_rep_buf(char *buf, size_t len, struct gsm_lchan *lchan, struct gsm_meas_rep *mr)
+static int print_meas_rep_buf(char *buf, size_t len, struct gsm_meas_rep *mr)
 {
-	const char *name = "";
-	struct bsc_subscr *bsub = NULL;
 	struct osmo_strbuf sb = { .buf = buf, .len = len };
 
-	if (lchan && lchan->conn) {
-		bsub = lchan->conn->bsub;
-		if (bsub) {
-			name = bsc_subscr_name(bsub);
-		} else
-			name = lchan->name;
-	}
-
-	OSMO_STRBUF_PRINTF(sb, "[%s] MEASUREMENT RESULT NR=%d ", name, mr->nr);
+	OSMO_STRBUF_PRINTF(sb, "MEASUREMENT RESULT NR=%d ", mr->nr);
 
 	if (mr->flags & MEAS_REP_F_DL_DTX)
 		OSMO_STRBUF_PRINTF(sb, "DTXd ");
@@ -1222,25 +1212,30 @@
 	return sb.chars_needed;
 }
 
-static char *print_meas_rep_c(void *ctx, struct gsm_lchan *lchan, struct gsm_meas_rep *mr)
+static char *print_meas_rep_c(void *ctx, struct gsm_meas_rep *mr)
 {
 	/* A naive count of required characters gets me to ~200, so 256 should be safe to get a large enough buffer on
 	 * the first time. */
-	OSMO_NAME_C_IMPL(ctx, 256, "ERROR", print_meas_rep_buf, lchan, mr)
+	OSMO_NAME_C_IMPL(ctx, 256, "ERROR", print_meas_rep_buf, mr)
 }
 
 static void print_meas_rep(struct gsm_lchan *lchan, struct gsm_meas_rep *mr)
 {
 	int i;
+	const char *name = "";
 	struct bsc_subscr *bsub = NULL;
 
 	if (lchan && lchan->conn) {
 		bsub = lchan->conn->bsub;
-		if (bsub)
+		if (bsub) {
 			log_set_context(LOG_CTX_BSC_SUBSCR, bsub);
+			name = bsc_subscr_name(bsub);
+		} else {
+			name = lchan->name;
+		}
 	}
 
-	DEBUGP(DMEAS, "%s\n", print_meas_rep_c(OTC_SELECT, lchan, mr));
+	DEBUGP(DMEAS, "[%s] %s\n", name, print_meas_rep_c(OTC_SELECT, mr));
 
 	if (mr->num_cell != 7
 	    && log_check_level(DMEAS, LOGL_DEBUG)) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: If965c7dc6b989ee758ddec0190ec1cce8363b240
Gerrit-Change-Number: 26145
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211108/7bfe753a/attachment.htm>


More information about the gerrit-log mailing list