Skip to content

Commit

Permalink
batman-adv: Move compare_orig to originator.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sven Eckelmann committed Jun 20, 2011
1 parent ecbd532 commit b8e2dd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 8 additions & 0 deletions net/batman-adv/originator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions net/batman-adv/originator.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b8e2dd1

Please sign in to comment.