Change in osmo-bts[master]: common: make the arguments of phy_{link, instance}_name() const

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
Wed May 19 15:01:08 UTC 2021


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/24287 )


Change subject: common: make the arguments of phy_{link,instance}_name() const
......................................................................

common: make the arguments of phy_{link,instance}_name() const

Change-Id: Ic01d131148065c9143d3a90f8020e2e133941292
Related: CID#236092 "Dereference before null check"
---
M include/osmo-bts/phy_link.h
M src/common/phy_link.c
2 files changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/24287/1

diff --git a/include/osmo-bts/phy_link.h b/include/osmo-bts/phy_link.h
index becc442..bd1a0c3 100644
--- a/include/osmo-bts/phy_link.h
+++ b/include/osmo-bts/phy_link.h
@@ -155,7 +155,7 @@
 struct phy_link *phy_link_by_num(int num);
 struct phy_link *phy_link_create(void *ctx, int num);
 void phy_link_destroy(struct phy_link *plink);
-const char *phy_link_name(struct phy_link *plink);
+const char *phy_link_name(const struct phy_link *plink);
 void phy_link_state_set(struct phy_link *plink, enum phy_link_state state);
 enum phy_link_state phy_link_state_get(struct phy_link *plink);
 const char *phy_link_state_name(enum phy_link_state state);
@@ -165,7 +165,7 @@
 struct phy_instance *phy_instance_create(struct phy_link *plink, int num);
 void phy_instance_link_to_trx(struct phy_instance *pinst, struct gsm_bts_trx *trx);
 void phy_instance_destroy(struct phy_instance *pinst);
-const char *phy_instance_name(struct phy_instance *pinst);
+const char *phy_instance_name(const struct phy_instance *pinst);
 
 static inline struct phy_instance *trx_phy_instance(const struct gsm_bts_trx *trx)
 {
diff --git a/src/common/phy_link.c b/src/common/phy_link.c
index 411f870..93c6f2c 100644
--- a/src/common/phy_link.c
+++ b/src/common/phy_link.c
@@ -146,7 +146,7 @@
 }
 
 static char name_buf[32];
-const char *phy_link_name(struct phy_link *plink)
+const char *phy_link_name(const struct phy_link *plink)
 {
 	snprintf(name_buf, sizeof(name_buf), "phy%u", plink->num);
 	return name_buf;
@@ -167,7 +167,7 @@
 	return 0;
 }
 
-const char *phy_instance_name(struct phy_instance *pinst)
+const char *phy_instance_name(const struct phy_instance *pinst)
 {
 	snprintf(name_buf, sizeof(name_buf), "phy%u.%u", pinst->phy_link->num,
 		 pinst->num);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ic01d131148065c9143d3a90f8020e2e133941292
Gerrit-Change-Number: 24287
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210519/2b18a811/attachment.htm>


More information about the gerrit-log mailing list