[MERGED] libosmocore[master]: features: define osmo_bts_*_feature() as static inline

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Mar 5 17:37:46 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: features: define osmo_bts_*_feature() as static inline
......................................................................


features: define osmo_bts_*_feature() as static inline

The functions osmo_bts_set_feature() and osmo_bts_has_feature() are
currently defined as inline. Since inline is a hinting, the compiler
might choose not to inline the function. This eventually leads to
linker problems because the function is then defined multiple times.

- use "static inline" instead of "inline" only.

This patch is a follow up patch to
Change Id 680acae725b2b8dda2f239ff20073306fdfb3f6e

Change-Id: Iddd97415a17b06b69f69ddca2e2e296eb2f23a89
---
M include/osmocom/gsm/bts_features.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h
index f9b0142..e84f95b 100644
--- a/include/osmocom/gsm/bts_features.h
+++ b/include/osmocom/gsm/bts_features.h
@@ -30,13 +30,13 @@
 
 const char *osmo_bts_feature_name(enum osmo_bts_features feature);
 
-inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
+static inline int osmo_bts_set_feature(struct bitvec *features, enum osmo_bts_features feature)
 {
 	OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
 	return bitvec_set_bit_pos(features, feature, 1);
 }
 
-inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
+static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)
 {
 	OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);
 	return bitvec_get_bit_pos(features, feature);

-- 
To view, visit https://gerrit.osmocom.org/7084
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iddd97415a17b06b69f69ddca2e2e296eb2f23a89
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list