* [B.A.T.M.A.N.] [PATCH] batman-adv: Move compare_orig to originator.c
@ 2011-06-15 13:08 Sven Eckelmann
2011-06-15 20:29 ` Marek Lindner
0 siblings, 1 reply; 2+ messages in thread
From: Sven Eckelmann @ 2011-06-15 13:08 UTC (permalink / raw)
To: b.a.t.m.a.n
compare_orig is only used in context of orig_node which is managed
inside originator.c. It is not necessary to keep that function inside
the header originator.h.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
originator.c | 8 ++++++++
originator.h | 8 --------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/originator.c b/originator.c
index 62d8196..338b3c5 100644
--- a/originator.c
+++ b/originator.c
@@ -37,6 +37,14 @@ static void start_purge_timer(struct bat_priv *bat_priv)
queue_delayed_work(bat_event_workqueue, &bat_priv->orig_work, 1 * HZ);
}
+/* returns 1 if they are the same originator */
+static int compare_orig(const struct hlist_node *node, const void *data2)
+{
+ const void *data1 = container_of(node, struct orig_node, hash_entry);
+
+ return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
+}
+
int originator_init(struct bat_priv *bat_priv)
{
if (bat_priv->orig_hash)
diff --git a/originator.h b/originator.h
index 8e307af..cfc1f60 100644
--- a/originator.h
+++ b/originator.h
@@ -40,14 +40,6 @@ int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
-/* returns 1 if they are the same originator */
-static inline int compare_orig(const struct hlist_node *node, const void *data2)
-{
- const void *data1 = container_of(node, struct orig_node, hash_entry);
-
- return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
-}
-
/* hashfunction to choose an entry in a hash table of given size */
/* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */
static inline int choose_orig(const void *data, int32_t size)
--
1.7.5.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Move compare_orig to originator.c
2011-06-15 13:08 [B.A.T.M.A.N.] [PATCH] batman-adv: Move compare_orig to originator.c Sven Eckelmann
@ 2011-06-15 20:29 ` Marek Lindner
0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-06-15 20:29 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Wednesday, June 15, 2011 03:08:59 PM Sven Eckelmann wrote:
> compare_orig is only used in context of orig_node which is managed
> inside originator.c. It is not necessary to keep that function inside
> the header originator.h.
Applied in revision 54bd925.
Thanks,
Marek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-15 20:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-15 13:08 [B.A.T.M.A.N.] [PATCH] batman-adv: Move compare_orig to originator.c Sven Eckelmann
2011-06-15 20:29 ` Marek Lindner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).