dexter has submitted this change. (
https://gerrit.osmocom.org/c/osmo-pcu/+/33543 )
Change subject: neigh_cache: make neigh_cache_lookup_entry static
......................................................................
neigh_cache: make neigh_cache_lookup_entry static
The function neigh_cache_lookup_entry() is only used from within
neigh_cache.c. Let's make it static and move it, so that we do not need
the prototype declaration.
Change-Id: I1ea72ad9c79bfeaa06391cf8f62b284fbfea8efc
---
M src/neigh_cache.c
M src/neigh_cache.h
2 files changed, 33 insertions(+), 22 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/neigh_cache.c b/src/neigh_cache.c
index 28e27e6..129e40b 100644
--- a/src/neigh_cache.c
+++ b/src/neigh_cache.c
@@ -89,6 +89,26 @@
neigh_cache_schedule_cleanup(cache);
}
+static struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
+ const struct neigh_cache_entry_key *key)
+{
+ struct neigh_cache_entry *tmp;
+ llist_for_each_entry(tmp, &cache->list, list) {
+ if (neigh_cache_entry_key_eq(&tmp->key, key))
+ return tmp;
+ }
+ return NULL;
+}
+
+const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
+ const struct neigh_cache_entry_key *key)
+{
+ struct neigh_cache_entry *it = neigh_cache_lookup_entry(cache, key);
+ if (it)
+ return &it->value;
+ return NULL;
+}
+
struct neigh_cache_entry *neigh_cache_add(struct neigh_cache *cache,
const struct neigh_cache_entry_key *key,
const struct osmo_cell_global_id_ps *value)
@@ -119,26 +139,6 @@
return it;
}
-struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
- const struct neigh_cache_entry_key *key)
-{
- struct neigh_cache_entry *tmp;
- llist_for_each_entry(tmp, &cache->list, list) {
- if (neigh_cache_entry_key_eq(&tmp->key, key))
- return tmp;
- }
- return NULL;
-}
-
-const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
- const struct neigh_cache_entry_key *key)
-{
- struct neigh_cache_entry *it = neigh_cache_lookup_entry(cache, key);
- if (it)
- return &it->value;
- return NULL;
-}
-
void neigh_cache_free(struct neigh_cache *cache)
{
struct neigh_cache_entry *it, *tmp;
diff --git a/src/neigh_cache.h b/src/neigh_cache.h
index 76706ab..777a705 100644
--- a/src/neigh_cache.h
+++ b/src/neigh_cache.h
@@ -65,8 +65,6 @@
struct neigh_cache_entry *neigh_cache_add(struct neigh_cache *cache,
const struct neigh_cache_entry_key *key,
const struct osmo_cell_global_id_ps *value);
-struct neigh_cache_entry *neigh_cache_lookup_entry(struct neigh_cache *cache,
- const struct neigh_cache_entry_key *key);
const struct osmo_cell_global_id_ps *neigh_cache_lookup_value(struct neigh_cache *cache,
const struct neigh_cache_entry_key *key);
void neigh_cache_free(struct neigh_cache *cache);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-pcu/+/33543
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I1ea72ad9c79bfeaa06391cf8f62b284fbfea8efc
Gerrit-Change-Number: 33543
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged