Change in osmocom-bb[master]: trxcon/trxcon.h: do not share tall_trx_ctx

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

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Wed Jan 16 13:18:23 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/12584


Change subject: trxcon/trxcon.h: do not share tall_trx_ctx
......................................................................

trxcon/trxcon.h: do not share tall_trx_ctx

Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
---
M src/host/trxcon/logging.c
M src/host/trxcon/trxcon.c
M src/host/trxcon/trxcon.h
3 files changed, 10 insertions(+), 10 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/84/12584/1

diff --git a/src/host/trxcon/logging.c b/src/host/trxcon/logging.c
index 6a3043b..b12df51 100644
--- a/src/host/trxcon/logging.c
+++ b/src/host/trxcon/logging.c
@@ -26,7 +26,8 @@
 #include <osmocom/core/utils.h>
 
 #include "logging.h"
-#include "trxcon.h"
+
+extern void *tall_trxcon_ctx;
 
 static struct log_info_cat trx_log_info_cat[] = {
 	[DAPP] = {
@@ -80,7 +81,7 @@
 
 int trx_log_init(const char *category_mask)
 {
-	osmo_init_logging2(tall_trx_ctx, &trx_log_info);
+	osmo_init_logging2(tall_trxcon_ctx, &trx_log_info);
 
 	if (category_mask)
 		log_parse_category_mask(osmo_stderr_target, category_mask);
diff --git a/src/host/trxcon/trxcon.c b/src/host/trxcon/trxcon.c
index 777138f..500d7e7 100644
--- a/src/host/trxcon/trxcon.c
+++ b/src/host/trxcon/trxcon.c
@@ -74,7 +74,7 @@
 	uint32_t trx_fn_advance;
 } app_data;
 
-void *tall_trx_ctx = NULL;
+void *tall_trxcon_ctx = NULL;
 struct osmo_fsm_inst *trxcon_fsm;
 
 static void trxcon_fsm_idle_action(struct osmo_fsm_inst *fi,
@@ -242,7 +242,7 @@
 	case SIGABRT:
 	case SIGUSR1:
 	case SIGUSR2:
-		talloc_report_full(tall_trx_ctx, stderr);
+		talloc_report_full(tall_trxcon_ctx, stderr);
 		break;
 	default:
 		break;
@@ -261,8 +261,8 @@
 	talloc_enable_null_tracking();
 
 	/* Init talloc memory management system */
-	tall_trx_ctx = talloc_init("trxcon context");
-	msgb_talloc_ctx_init(tall_trx_ctx, 0);
+	tall_trxcon_ctx = talloc_init("trxcon context");
+	msgb_talloc_ctx_init(tall_trxcon_ctx, 0);
 
 	/* Setup signal handlers */
 	signal(SIGINT, &signal_handler);
@@ -275,7 +275,7 @@
 
 	/* Allocate the application state machine */
 	osmo_fsm_register(&trxcon_fsm_def);
-	trxcon_fsm = osmo_fsm_inst_alloc(&trxcon_fsm_def, tall_trx_ctx,
+	trxcon_fsm = osmo_fsm_inst_alloc(&trxcon_fsm_def, tall_trxcon_ctx,
 		NULL, LOGL_DEBUG, "main");
 
 	/* Init L1CTL server */
@@ -331,8 +331,8 @@
 	 * Print report for the root talloc context in order
 	 * to be able to find and fix potential memory leaks.
 	 */
-	talloc_report_full(tall_trx_ctx, stderr);
-	talloc_free(tall_trx_ctx);
+	talloc_report_full(tall_trxcon_ctx, stderr);
+	talloc_free(tall_trxcon_ctx);
 
 	/* Make both Valgrind and ASAN happy */
 	talloc_report_full(NULL, stderr);
diff --git a/src/host/trxcon/trxcon.h b/src/host/trxcon/trxcon.h
index 65b5e85..f66a628 100644
--- a/src/host/trxcon/trxcon.h
+++ b/src/host/trxcon/trxcon.h
@@ -3,7 +3,6 @@
 #define GEN_MASK(state) (0x01 << state)
 
 extern struct osmo_fsm_inst *trxcon_fsm;
-extern void *tall_trx_ctx;
 
 enum trxcon_fsm_states {
 	TRXCON_STATE_IDLE = 0,

-- 
To view, visit https://gerrit.osmocom.org/12584
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a2231eb880a995d3296b94481a7799e6ff07489
Gerrit-Change-Number: 12584
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190116/514e6cc5/attachment.htm>


More information about the gerrit-log mailing list