public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete
@ 2016-07-21 23:30 Sven Eckelmann
  2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-07-21 23:30 UTC (permalink / raw)
  To: b.a.t.m.a.n

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 net/batman-adv/hash.h | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h
index cbbf870..557a704 100644
--- a/net/batman-adv/hash.h
+++ b/net/batman-adv/hash.h
@@ -61,36 +61,6 @@ void batadv_hash_set_lock_class(struct batadv_hashtable *hash,
 /* free only the hashtable and the hash itself. */
 void batadv_hash_destroy(struct batadv_hashtable *hash);
 
-/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
- * called to remove the elements inside of the hash.  if you don't remove the
- * elements, memory might be leaked.
- */
-static inline void batadv_hash_delete(struct batadv_hashtable *hash,
-				      batadv_hashdata_free_cb free_cb,
-				      void *arg)
-{
-	struct hlist_head *head;
-	struct hlist_node *node, *node_tmp;
-	spinlock_t *list_lock; /* spinlock to protect write access */
-	u32 i;
-
-	for (i = 0; i < hash->size; i++) {
-		head = &hash->table[i];
-		list_lock = &hash->list_locks[i];
-
-		spin_lock_bh(list_lock);
-		hlist_for_each_safe(node, node_tmp, head) {
-			hlist_del_rcu(node);
-
-			if (free_cb)
-				free_cb(node, arg);
-		}
-		spin_unlock_bh(list_lock);
-	}
-
-	batadv_hash_destroy(hash);
-}
-
 /**
  *	batadv_hash_add - adds data to the hashtable
  *	@hash: storage hash table

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-18 11:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-21 23:30 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
2016-10-18 11:28   ` [B.A.T.M.A.N.] [2/3] " Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type Sven Eckelmann
2016-10-18 11:29   ` [B.A.T.M.A.N.] [3/3] " Sven Eckelmann
2016-10-18 11:27 ` [B.A.T.M.A.N.] [1/3] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox