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 05/13] batman-adv: Prefix unicast local static functions with batadv_
Date: Wed, 16 May 2012 20:23:17 +0200 [thread overview]
Message-ID: <1337192605-8652-5-git-send-email-sven@narfation.org> (raw)
In-Reply-To: <1337192605-8652-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>
---
unicast.c | 47 +++++++++++++++++++++++++----------------------
1 file changed, 25 insertions(+), 22 deletions(-)
diff --git a/unicast.c b/unicast.c
index d5efa40..bc2f897 100644
--- a/unicast.c
+++ b/unicast.c
@@ -29,9 +29,10 @@
#include "hard-interface.h"
-static struct sk_buff *frag_merge_packet(struct list_head *head,
- struct frag_packet_list_entry *tfp,
- struct sk_buff *skb)
+static struct sk_buff *
+batadv_frag_merge_packet(struct list_head *head,
+ struct frag_packet_list_entry *tfp,
+ struct sk_buff *skb)
{
struct unicast_frag_packet *up =
(struct unicast_frag_packet *)skb->data;
@@ -75,7 +76,8 @@ err:
return NULL;
}
-static void frag_create_entry(struct list_head *head, struct sk_buff *skb)
+static void batadv_frag_create_entry(struct list_head *head,
+ struct sk_buff *skb)
{
struct frag_packet_list_entry *tfp;
struct unicast_frag_packet *up =
@@ -91,7 +93,7 @@ static void frag_create_entry(struct list_head *head, struct sk_buff *skb)
return;
}
-static int frag_create_buffer(struct list_head *head)
+static int batadv_frag_create_buffer(struct list_head *head)
{
int i;
struct frag_packet_list_entry *tfp;
@@ -111,8 +113,9 @@ static int frag_create_buffer(struct list_head *head)
return 0;
}
-static struct frag_packet_list_entry *frag_search_packet(struct list_head *head,
- const struct unicast_frag_packet *up)
+static struct frag_packet_list_entry *
+batadv_frag_search_packet(struct list_head *head,
+ const struct unicast_frag_packet *up)
{
struct frag_packet_list_entry *tfp;
struct unicast_frag_packet *tmp_up = NULL;
@@ -188,22 +191,22 @@ int batadv_frag_reassemble_skb(struct sk_buff *skb, struct bat_priv *bat_priv,
orig_node->last_frag_packet = jiffies;
if (list_empty(&orig_node->frag_list) &&
- frag_create_buffer(&orig_node->frag_list)) {
+ batadv_frag_create_buffer(&orig_node->frag_list)) {
pr_debug("couldn't create frag buffer\n");
goto out;
}
- tmp_frag_entry = frag_search_packet(&orig_node->frag_list,
- unicast_packet);
+ tmp_frag_entry = batadv_frag_search_packet(&orig_node->frag_list,
+ unicast_packet);
if (!tmp_frag_entry) {
- frag_create_entry(&orig_node->frag_list, skb);
+ batadv_frag_create_entry(&orig_node->frag_list, skb);
ret = NET_RX_SUCCESS;
goto out;
}
- *new_skb = frag_merge_packet(&orig_node->frag_list, tmp_frag_entry,
- skb);
+ *new_skb = batadv_frag_merge_packet(&orig_node->frag_list,
+ tmp_frag_entry, skb);
/* if not, merge failed */
if (*new_skb)
ret = NET_RX_SUCCESS;
@@ -281,8 +284,8 @@ out:
return ret;
}
-static bool pull_and_fill_unicast(struct sk_buff *skb, int hdr_size,
- struct orig_node *orig_node)
+static bool batadv_pull_and_fill_unicast(struct sk_buff *skb, int hdr_size,
+ struct orig_node *orig_node)
{
struct unicast_packet *unicast_packet;
@@ -304,11 +307,11 @@ static bool pull_and_fill_unicast(struct sk_buff *skb, int hdr_size,
return true;
}
-static bool prepare_unicast_packet(struct sk_buff *skb,
- struct orig_node *orig_node)
+static bool batadv_prepare_unicast_packet(struct sk_buff *skb,
+ struct orig_node *orig_node)
{
- return pull_and_fill_unicast(skb, sizeof(struct unicast_packet),
- orig_node);
+ return batadv_pull_and_fill_unicast(skb, sizeof(struct unicast_packet),
+ orig_node);
}
bool batadv_prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
@@ -328,8 +331,8 @@ bool batadv_prepare_unicast_4addr_packet(struct bat_priv *bat_priv,
* We can do that because the first member of the unicast_4addr_packet
* is of type struct unicast_packet
*/
- if (!pull_and_fill_unicast(skb, sizeof(*unicast_4addr_packet),
- orig_node))
+ if (!batadv_pull_and_fill_unicast(skb, sizeof(*unicast_4addr_packet),
+ orig_node))
goto out;
unicast_4addr_packet = (struct unicast_4addr_packet *)skb->data;
@@ -379,7 +382,7 @@ find_router:
switch (packet_type) {
case BAT_UNICAST:
- prepare_unicast_packet(skb, orig_node);
+ batadv_prepare_unicast_packet(skb, orig_node);
break;
case BAT_UNICAST_4ADDR:
batadv_prepare_unicast_4addr_packet(bat_priv, skb, orig_node,
--
1.7.10
next prev parent reply other threads:[~2012-05-16 18:23 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 17:38 [B.A.T.M.A.N.] Remaining cleanup/prefixing patches Sven Eckelmann
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 01/13] batman-adv: Prefix routing local static functions with batadv_ Sven Eckelmann
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 02/13] batman-adv: Prefix send " Sven Eckelmann
2012-05-18 8:26 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 03/13] batman-adv: Prefix soft-interface " Sven Eckelmann
2012-05-18 8:28 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 04/13] batman-adv: Prefix translation-table " Sven Eckelmann
2012-05-18 8:34 ` Marek Lindner
2012-05-16 18:23 ` Sven Eckelmann [this message]
2012-05-18 8:36 ` [B.A.T.M.A.N.] [PATCH 05/13] batman-adv: Prefix unicast " Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 06/13] batman-adv: Prefix vis " Sven Eckelmann
2012-05-18 9:58 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 07/13] batman-adv: Prefix main " Sven Eckelmann
2012-05-18 12:37 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 08/13] batman-adv: Mark only locally used symbol batadv_tt_local_crc as static Sven Eckelmann
2012-05-18 12:44 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 09/13] batman-adv: Replace simple function like defines with functions Sven Eckelmann
2012-05-18 14:41 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 10/13] batman-adv: Prefix remaining function like macros with batadv_ Sven Eckelmann
2012-05-18 15:00 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 11/13] batman-adv: Directly print to seq_file in vis Sven Eckelmann
2012-05-18 15:03 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 12/13] batman-adv: Remove unused define BAT_ATTR_HIF_UINT Sven Eckelmann
2012-05-18 15:16 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Prefix bat_sysfs local static functions with batadv_ Sven Eckelmann
2012-05-18 16:01 ` Marek Lindner
2012-05-16 18:23 ` [B.A.T.M.A.N.] [PATCH 13/13] batman-adv: Use typedef instead of define for type dat_addr_t Sven Eckelmann
2012-05-18 16:03 ` Marek Lindner
2012-05-18 8:24 ` [B.A.T.M.A.N.] [PATCH 01/13] batman-adv: Prefix routing local static functions with batadv_ 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=1337192605-8652-5-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