public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 11/18] batman-adv: Prefix originator local static functions with batadv_
Date: Sat, 12 May 2012 18:34:00 +0200	[thread overview]
Message-ID: <1336840447-6580-11-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1336840447-6580-1-git-send-email-sven@narfation.org>

All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 originator.c |   54 +++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/originator.c b/originator.c
index 8f908be..970dde5 100644
--- a/originator.c
+++ b/originator.c
@@ -29,17 +29,17 @@
 #include "soft-interface.h"
 #include "bridge_loop_avoidance.h"
 
-static void purge_orig(struct work_struct *work);
+static void batadv_purge_orig(struct work_struct *work);
 
-static void start_purge_timer(struct bat_priv *bat_priv)
+static void batadv_start_purge_timer(struct bat_priv *bat_priv)
 {
-	INIT_DELAYED_WORK(&bat_priv->orig_work, purge_orig);
+	INIT_DELAYED_WORK(&bat_priv->orig_work, batadv_purge_orig);
 	queue_delayed_work(batadv_event_workqueue,
 			   &bat_priv->orig_work, msecs_to_jiffies(1000));
 }
 
 /* returns 1 if they are the same originator */
-static int compare_orig(const struct hlist_node *node, const void *data2)
+static int batadv_compare_orig(const struct hlist_node *node, const void *data2)
 {
 	const void *data1 = container_of(node, struct orig_node, hash_entry);
 
@@ -56,7 +56,7 @@ int batadv_originator_init(struct bat_priv *bat_priv)
 	if (!bat_priv->orig_hash)
 		goto err;
 
-	start_purge_timer(bat_priv);
+	batadv_start_purge_timer(bat_priv);
 	return 0;
 
 err:
@@ -111,7 +111,7 @@ out:
 	return neigh_node;
 }
 
-static void orig_node_free_rcu(struct rcu_head *rcu)
+static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
 {
 	struct hlist_node *node, *node_tmp;
 	struct neigh_node *neigh_node, *tmp_neigh_node;
@@ -150,7 +150,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
 void batadv_orig_node_free_ref(struct orig_node *orig_node)
 {
 	if (atomic_dec_and_test(&orig_node->refcount))
-		call_rcu(&orig_node->rcu, orig_node_free_rcu);
+		call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
 }
 
 void batadv_originator_free(struct bat_priv *bat_priv)
@@ -250,7 +250,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
 	if (!orig_node->bcast_own_sum)
 		goto free_bcast_own;
 
-	hash_added = batadv_hash_add(bat_priv->orig_hash, compare_orig,
+	hash_added = batadv_hash_add(bat_priv->orig_hash, batadv_compare_orig,
 				     batadv_choose_orig, orig_node,
 				     &orig_node->hash_entry);
 	if (hash_added != 0)
@@ -266,9 +266,9 @@ free_orig_node:
 	return NULL;
 }
 
-static bool purge_orig_neighbors(struct bat_priv *bat_priv,
-				 struct orig_node *orig_node,
-				 struct neigh_node **best_neigh_node)
+static bool batadv_purge_orig_neighbors(struct bat_priv *bat_priv,
+					struct orig_node *orig_node,
+					struct neigh_node **best_neigh_node)
 {
 	struct hlist_node *node, *node_tmp;
 	struct neigh_node *neigh_node;
@@ -321,8 +321,8 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
 	return neigh_purged;
 }
 
-static bool purge_orig_node(struct bat_priv *bat_priv,
-			    struct orig_node *orig_node)
+static bool batadv_purge_orig_node(struct bat_priv *bat_priv,
+				   struct orig_node *orig_node)
 {
 	struct neigh_node *best_neigh_node;
 
@@ -333,8 +333,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
 			   jiffies_to_msecs(orig_node->last_seen));
 		return true;
 	} else {
-		if (purge_orig_neighbors(bat_priv, orig_node,
-					 &best_neigh_node))
+		if (batadv_purge_orig_neighbors(bat_priv, orig_node,
+						&best_neigh_node))
 			batadv_update_route(bat_priv, orig_node,
 					    best_neigh_node);
 	}
@@ -342,7 +342,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
 	return false;
 }
 
-static void _purge_orig(struct bat_priv *bat_priv)
+static void _batadv_purge_orig(struct bat_priv *bat_priv)
 {
 	struct hashtable_t *hash = bat_priv->orig_hash;
 	struct hlist_node *node, *node_tmp;
@@ -362,7 +362,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
 		spin_lock_bh(list_lock);
 		hlist_for_each_entry_safe(orig_node, node, node_tmp,
 					  head, hash_entry) {
-			if (purge_orig_node(bat_priv, orig_node)) {
+			if (batadv_purge_orig_node(bat_priv, orig_node)) {
 				if (orig_node->gw_flags)
 					batadv_gw_node_delete(bat_priv,
 							      orig_node);
@@ -382,20 +382,20 @@ static void _purge_orig(struct bat_priv *bat_priv)
 	batadv_gw_election(bat_priv);
 }
 
-static void purge_orig(struct work_struct *work)
+static void batadv_purge_orig(struct work_struct *work)
 {
 	struct delayed_work *delayed_work =
 		container_of(work, struct delayed_work, work);
 	struct bat_priv *bat_priv =
 		container_of(delayed_work, struct bat_priv, orig_work);
 
-	_purge_orig(bat_priv);
-	start_purge_timer(bat_priv);
+	_batadv_purge_orig(bat_priv);
+	batadv_start_purge_timer(bat_priv);
 }
 
 void batadv_purge_orig_ref(struct bat_priv *bat_priv)
 {
-	_purge_orig(bat_priv);
+	_batadv_purge_orig(bat_priv);
 }
 
 int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
@@ -485,7 +485,7 @@ out:
 	return ret;
 }
 
-static int orig_node_add_if(struct orig_node *orig_node, int max_if_num)
+static int batadv_orig_node_add_if(struct orig_node *orig_node, int max_if_num)
 {
 	void *data_ptr;
 
@@ -530,7 +530,7 @@ int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
 			spin_lock_bh(&orig_node->ogm_cnt_lock);
-			ret = orig_node_add_if(orig_node, max_if_num);
+			ret = batadv_orig_node_add_if(orig_node, max_if_num);
 			spin_unlock_bh(&orig_node->ogm_cnt_lock);
 
 			if (ret == -ENOMEM)
@@ -546,8 +546,8 @@ err:
 	return -ENOMEM;
 }
 
-static int orig_node_del_if(struct orig_node *orig_node,
-		     int max_if_num, int del_if_num)
+static int batadv_orig_node_del_if(struct orig_node *orig_node,
+				   int max_if_num, int del_if_num)
 {
 	void *data_ptr = NULL;
 	int chunk_size;
@@ -614,8 +614,8 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
 			spin_lock_bh(&orig_node->ogm_cnt_lock);
-			ret = orig_node_del_if(orig_node, max_if_num,
-					hard_iface->if_num);
+			ret = batadv_orig_node_del_if(orig_node, max_if_num,
+						      hard_iface->if_num);
 			spin_unlock_bh(&orig_node->ogm_cnt_lock);
 
 			if (ret == -ENOMEM)
-- 
1.7.10


  parent reply	other threads:[~2012-05-12 16:34 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-12 16:33 [B.A.T.M.A.N.] [PATCH 01/18] batman-adv: Prefix bat_debugfs local static functions with batadv_ Sven Eckelmann
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 02/18] batman-adv: Prefix bat_iv_ogm " Sven Eckelmann
2012-05-15  8:50   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 03/18] batman-adv: Prefix bat_sysfs " Sven Eckelmann
2012-05-15  9:54   ` Marek Lindner
2012-05-16 17:23     ` Sven Eckelmann
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 04/18] batman-adv: Prefix bridge_loop_avoidance " Sven Eckelmann
2012-05-15 11:28   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 05/18] batman-adv: Prefix distributed-arp-table " Sven Eckelmann
2012-05-16  8:53   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 06/18] batman-adv: Prefix gateway_client " Sven Eckelmann
2012-05-16  8:55   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 07/18] batman-adv: Prefix gateway_common " Sven Eckelmann
2012-05-16  8:56   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 08/18] batman-adv: Prefix hard-interface " Sven Eckelmann
2012-05-16  8:58   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 09/18] batman-adv: Prefix hash " Sven Eckelmann
2012-05-16  8:59   ` Marek Lindner
2012-05-12 16:33 ` [B.A.T.M.A.N.] [PATCH 10/18] batman-adv: Prefix icmp_socket " Sven Eckelmann
2012-05-16  9:02   ` Marek Lindner
2012-05-12 16:34 ` Sven Eckelmann [this message]
2012-05-16 10:34   ` [B.A.T.M.A.N.] [PATCH 11/18] batman-adv: Prefix originator " Marek Lindner
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 12/18] batman-adv: Prefix routing " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 13/18] batman-adv: Prefix send " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 14/18] batman-adv: Prefix soft-interface " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 15/18] batman-adv: Prefix translation-table " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 16/18] batman-adv: Prefix unicast " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 17/18] batman-adv: Prefix vis " Sven Eckelmann
2012-05-12 16:34 ` [B.A.T.M.A.N.] [PATCH 18/18] batman-adv: Prefix main " Sven Eckelmann
2012-05-15  8:06 ` [B.A.T.M.A.N.] [PATCH 01/18] batman-adv: Prefix bat_debugfs " Marek Lindner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336840447-6580-11-git-send-email-sven@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox