aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-06-07 15:41:23 +0200
committerfixeria <vyanitskiy@sysmocom.de>2021-06-10 21:50:48 +0000
commit4590b099bf4409b8456872bd1eec9cf3ba2a42a9 (patch)
treec6c142776daa0f3c50a02d2243632fada69e56a0
parent52f6fc5aab7e4f9d9e354f256fc1d003530b8d66 (diff)
osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()
-rw-r--r--src/osmo-bts-octphy/l1_oml.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 9bd01f4b..acd43e4d 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1119,13 +1119,6 @@ int l1if_rsl_chan_act(struct gsm_lchan *lchan)
return 0;
}
-#define talloc_replace(dst, ctx, src) \
- do { \
- if (dst) \
- talloc_free(dst); \
- dst = talloc_strdup(ctx, (const char *) src); \
- } while (0)
-
static int app_info_sys_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, void *data)
{
tOCTVC1_MAIN_MSG_APPLICATION_INFO_SYSTEM_RSP *aisr =
@@ -1145,8 +1138,10 @@ static int app_info_sys_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp, voi
LOGP(DL1C, LOGL_INFO, "Note: compiled without multi-trx support.\n");
#endif
- talloc_replace(fl1h->info.system.platform, fl1h, aisr->szPlatform);
- talloc_replace(fl1h->info.system.version, fl1h, aisr->szVersion);
+ osmo_talloc_replace_string(fl1h, &fl1h->info.system.platform,
+ (const char *) aisr->szPlatform);
+ osmo_talloc_replace_string(fl1h, &fl1h->info.system.version,
+ (const char *) aisr->szVersion);
msgb_free(resp);
@@ -1210,9 +1205,12 @@ static int app_info_compl_cb(struct octphy_hdl *fl1h, struct msgb *resp,
}
}
- talloc_replace(fl1h->info.app.name, fl1h, air->szName);
- talloc_replace(fl1h->info.app.description, fl1h, air->szDescription);
- talloc_replace(fl1h->info.app.version, fl1h, air->szVersion);
+ osmo_talloc_replace_string(fl1h, &fl1h->info.app.name,
+ (const char *) air->szName);
+ osmo_talloc_replace_string(fl1h, &fl1h->info.app.description,
+ (const char *) air->szDescription);
+ osmo_talloc_replace_string(fl1h, &fl1h->info.app.version,
+ (const char *) air->szVersion);
OSMO_ASSERT(strlen(ver_hdr) < sizeof(pinst->version));
osmo_strlcpy(pinst->version, ver_hdr, strlen(ver_hdr));