Skip to content

Commit b8e2dd1

Browse files
committed
batman-adv: Move compare_orig to originator.c
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>
1 parent ecbd532 commit b8e2dd1

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎net/batman-adv/originator.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ static void start_purge_timer(struct bat_priv *bat_priv)
3737
queue_delayed_work(bat_event_workqueue, &bat_priv->orig_work, 1 * HZ);
3838
}
3939

40+
/* returns 1 if they are the same originator */
41+
static int compare_orig(const struct hlist_node *node, const void *data2)
42+
{
43+
const void *data1 = container_of(node, struct orig_node, hash_entry);
44+
45+
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
46+
}
47+
4048
int originator_init(struct bat_priv *bat_priv)
4149
{
4250
if (bat_priv->orig_hash)

‎net/batman-adv/originator.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,6 @@ int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num);
4040
int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num);
4141

4242

43-
/* returns 1 if they are the same originator */
44-
static inline int compare_orig(const struct hlist_node *node, const void *data2)
45-
{
46-
const void *data1 = container_of(node, struct orig_node, hash_entry);
47-
48-
return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
49-
}
50-
5143
/* hashfunction to choose an entry in a hash table of given size */
5244
/* hash algorithm from http://en.wikipedia.org/wiki/Hash_table */
5345
static inline int choose_orig(const void *data, int32_t size)

0 commit comments

Comments
 (0)