Change in osmo-bts[master]: osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()

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
Thu Jun 10 21:50:48 UTC 2021


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

Change subject: osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()
......................................................................

osmo-bts-octphy: drop talloc_replace(), use osmo_talloc_replace_string()

Change-Id: Ied39cc594fedc712d751ab1c7b636bbbff527bd6
---
M src/osmo-bts-octphy/l1_oml.c
1 file changed, 10 insertions(+), 12 deletions(-)

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



diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 9bd01f4..acd43e4 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1119,13 +1119,6 @@
 	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 @@
 	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 @@
 		}
 	}
 
-	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));
 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ied39cc594fedc712d751ab1c7b636bbbff527bd6
Gerrit-Change-Number: 24597
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
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/20210610/f35c0034/attachment.htm>


More information about the gerrit-log mailing list