From 21142f789812553b56f493d79184f5a31ab7b1cd Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 16 Sep 2016 01:56:37 +0200 Subject: [PATCH] msgb ctx: use new msgb_talloc_ctx_init() in various main()s Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a --- src/common/main.c | 4 +--- src/osmo-bts-litecell15/misc/lc15bts_mgr.c | 4 +--- src/osmo-bts-sysmo/misc/sysmobts_mgr.c | 4 +--- tests/agch/agch_test.c | 5 +---- tests/cipher/cipher_test.c | 5 +---- tests/handover/handover_test.c | 4 +--- tests/paging/paging_test.c | 5 +---- 7 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/common/main.c b/src/common/main.c index 99febe038..60839df01 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -219,14 +219,12 @@ int bts_main(int argc, char **argv) struct gsm_bts_role_bts *btsb; struct gsm_bts_trx *trx; struct e1inp_line *line; - void *tall_msgb_ctx; int rc, i; printf("((*))\n |\n / \\ OsmoBTS\n"); tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); - tall_msgb_ctx = talloc_pool(tall_bts_ctx, 100*1024); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_bts_ctx, 100*1024); bts_log_init(NULL); diff --git a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c index c97525c8d..193e1085f 100644 --- a/src/osmo-bts-litecell15/misc/lc15bts_mgr.c +++ b/src/osmo-bts-litecell15/misc/lc15bts_mgr.c @@ -222,13 +222,11 @@ static int mgr_log_init(void) int main(int argc, char **argv) { - void *tall_msgb_ctx; int rc; tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); - tall_msgb_ctx = talloc_named_const(tall_mgr_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_mgr_ctx); mgr_log_init(); diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c index ccb84d8a7..f126db2d1 100644 --- a/src/osmo-bts-sysmo/misc/sysmobts_mgr.c +++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr.c @@ -245,13 +245,11 @@ static int mgr_log_init(void) int main(int argc, char **argv) { - void *tall_msgb_ctx; int rc; tall_mgr_ctx = talloc_named_const(NULL, 1, "bts manager"); - tall_msgb_ctx = talloc_named_const(tall_mgr_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_mgr_ctx, 0); mgr_log_init(); if (classify_bts() != 0) diff --git a/tests/agch/agch_test.c b/tests/agch/agch_test.c index 4175bdd64..e275c644a 100644 --- a/tests/agch/agch_test.c +++ b/tests/agch/agch_test.c @@ -224,11 +224,8 @@ static void test_agch_queue_length_computation(void) int main(int argc, char **argv) { - void *tall_msgb_ctx; - tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); - tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_bts_ctx, 0); bts_log_init(NULL); diff --git a/tests/cipher/cipher_test.c b/tests/cipher/cipher_test.c index a175012f4..c913925e4 100644 --- a/tests/cipher/cipher_test.c +++ b/tests/cipher/cipher_test.c @@ -66,11 +66,8 @@ static void test_cipher_parsing(void) int main(int argc, char **argv) { - void *tall_msgb_ctx; - tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); - tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_bts_ctx, 0); bts_log_init(NULL); diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index e1f4d86de..d1dc34ad1 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -58,7 +58,6 @@ int main(int argc, char **argv) { struct gsm_bts_role_bts *btsb; void *tall_bts_ctx; - void *tall_msgb_ctx; struct e1inp_line *line; struct gsm_lchan *lchan; struct osmo_phsap_prim nl1sap; @@ -67,8 +66,7 @@ int main(int argc, char **argv) int i; tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); - tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_bts_ctx, 0); bts_log_init(NULL); osmo_stderr_target->categories[DHO].loglevel = LOGL_DEBUG; diff --git a/tests/paging/paging_test.c b/tests/paging/paging_test.c index de839e47d..1d5f2162a 100644 --- a/tests/paging/paging_test.c +++ b/tests/paging/paging_test.c @@ -112,11 +112,8 @@ static void test_paging_sleep(void) int main(int argc, char **argv) { - void *tall_msgb_ctx; - tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context"); - tall_msgb_ctx = talloc_named_const(tall_bts_ctx, 1, "msgb"); - msgb_set_talloc_ctx(tall_msgb_ctx); + msgb_talloc_ctx_init(tall_bts_ctx, 0); bts_log_init(NULL);