common: make the arguments of phy_{link,instance}_name() const
Change-Id: Ic01d131148065c9143d3a90f8020e2e133941292 Related: CID#236092 "Dereference before null check"
This commit is contained in:
parent
6ad89f2f58
commit
e24279508d
|
@ -155,7 +155,7 @@ struct phy_instance {
|
|||
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_by_num(const struct phy_link *plink, int num);
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -146,7 +146,7 @@ void phy_link_destroy(struct phy_link *plink)
|
|||
}
|
||||
|
||||
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 @@ int phy_links_open(void)
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue