aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 07:48:53 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-24 12:41:40 -0400
commit9b4a1159dff76f938aa64f7000621552e4d9ad18 (patch)
treef1e99a20dcb439299b83a6e2c09bb0aa3edb398c
parent9e466250ede375482a9a65ca60765d24303099e9 (diff)
batman-adv: Prefix bitarray static inline functions with batadv_
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>
-rw-r--r--net/batman-adv/bat_iv_ogm.c13
-rw-r--r--net/batman-adv/bitarray.c8
-rw-r--r--net/batman-adv/bitarray.h6
-rw-r--r--net/batman-adv/routing.c4
4 files changed, 16 insertions, 15 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 94859d45ed6e..ad641e8d3c0f 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -901,9 +901,9 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
901 hlist_for_each_entry_rcu(tmp_neigh_node, node, 901 hlist_for_each_entry_rcu(tmp_neigh_node, node,
902 &orig_node->neigh_list, list) { 902 &orig_node->neigh_list, list) {
903 903
904 is_duplicate |= bat_test_bit(tmp_neigh_node->real_bits, 904 is_duplicate |= batadv_test_bit(tmp_neigh_node->real_bits,
905 orig_node->last_real_seqno, 905 orig_node->last_real_seqno,
906 seqno); 906 seqno);
907 907
908 if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) && 908 if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) &&
909 (tmp_neigh_node->if_incoming == if_incoming)) 909 (tmp_neigh_node->if_incoming == if_incoming))
@@ -1037,6 +1037,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1037 if (is_my_orig) { 1037 if (is_my_orig) {
1038 unsigned long *word; 1038 unsigned long *word;
1039 int offset; 1039 int offset;
1040 int32_t bit_pos;
1040 1041
1041 orig_neigh_node = batadv_get_orig_node(bat_priv, 1042 orig_neigh_node = batadv_get_orig_node(bat_priv,
1042 ethhdr->h_source); 1043 ethhdr->h_source);
@@ -1054,9 +1055,9 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
1054 1055
1055 spin_lock_bh(&orig_neigh_node->ogm_cnt_lock); 1056 spin_lock_bh(&orig_neigh_node->ogm_cnt_lock);
1056 word = &(orig_neigh_node->bcast_own[offset]); 1057 word = &(orig_neigh_node->bcast_own[offset]);
1057 bat_set_bit(word, 1058 bit_pos = if_incoming_seqno - 2;
1058 if_incoming_seqno - 1059 bit_pos -= ntohl(batman_ogm_packet->seqno);
1059 ntohl(batman_ogm_packet->seqno) - 2); 1060 batadv_set_bit(word, bit_pos);
1060 orig_neigh_node->bcast_own_sum[if_incoming->if_num] = 1061 orig_neigh_node->bcast_own_sum[if_incoming->if_num] =
1061 bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE); 1062 bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
1062 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); 1063 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c
index 838abbc73c6c..7a7065cc88cd 100644
--- a/net/batman-adv/bitarray.c
+++ b/net/batman-adv/bitarray.c
@@ -48,7 +48,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
48 */ 48 */
49 if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) { 49 if ((seq_num_diff <= 0) && (seq_num_diff > -TQ_LOCAL_WINDOW_SIZE)) {
50 if (set_mark) 50 if (set_mark)
51 bat_set_bit(seq_bits, -seq_num_diff); 51 batadv_set_bit(seq_bits, -seq_num_diff);
52 return 0; 52 return 0;
53 } 53 }
54 54
@@ -59,7 +59,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
59 batadv_bitmap_shift_left(seq_bits, seq_num_diff); 59 batadv_bitmap_shift_left(seq_bits, seq_num_diff);
60 60
61 if (set_mark) 61 if (set_mark)
62 bat_set_bit(seq_bits, 0); 62 batadv_set_bit(seq_bits, 0);
63 return 1; 63 return 1;
64 } 64 }
65 65
@@ -71,7 +71,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
71 seq_num_diff - 1); 71 seq_num_diff - 1);
72 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); 72 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
73 if (set_mark) 73 if (set_mark)
74 bat_set_bit(seq_bits, 0); 74 batadv_set_bit(seq_bits, 0);
75 return 1; 75 return 1;
76 } 76 }
77 77
@@ -88,7 +88,7 @@ int batadv_bit_get_packet(void *priv, unsigned long *seq_bits,
88 88
89 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE); 89 bitmap_zero(seq_bits, TQ_LOCAL_WINDOW_SIZE);
90 if (set_mark) 90 if (set_mark)
91 bat_set_bit(seq_bits, 0); 91 batadv_set_bit(seq_bits, 0);
92 92
93 return 1; 93 return 1;
94 } 94 }
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index 8ab542632343..7954ba81cece 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -23,8 +23,8 @@
23/* returns true if the corresponding bit in the given seq_bits indicates true 23/* returns true if the corresponding bit in the given seq_bits indicates true
24 * and curr_seqno is within range of last_seqno 24 * and curr_seqno is within range of last_seqno
25 */ 25 */
26static inline int bat_test_bit(const unsigned long *seq_bits, 26static inline int batadv_test_bit(const unsigned long *seq_bits,
27 uint32_t last_seqno, uint32_t curr_seqno) 27 uint32_t last_seqno, uint32_t curr_seqno)
28{ 28{
29 int32_t diff; 29 int32_t diff;
30 30
@@ -36,7 +36,7 @@ static inline int bat_test_bit(const unsigned long *seq_bits,
36} 36}
37 37
38/* turn corresponding bit on, so we can remember that we got the packet */ 38/* turn corresponding bit on, so we can remember that we got the packet */
39static inline void bat_set_bit(unsigned long *seq_bits, int32_t n) 39static inline void batadv_set_bit(unsigned long *seq_bits, int32_t n)
40{ 40{
41 /* if too old, just drop it */ 41 /* if too old, just drop it */
42 if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE) 42 if (n < 0 || n >= TQ_LOCAL_WINDOW_SIZE)
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 79f63cf11be4..9c90cceda17d 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -1086,8 +1086,8 @@ int batadv_recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
1086 spin_lock_bh(&orig_node->bcast_seqno_lock); 1086 spin_lock_bh(&orig_node->bcast_seqno_lock);
1087 1087
1088 /* check whether the packet is a duplicate */ 1088 /* check whether the packet is a duplicate */
1089 if (bat_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno, 1089 if (batadv_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno,
1090 ntohl(bcast_packet->seqno))) 1090 ntohl(bcast_packet->seqno)))
1091 goto spin_unlock; 1091 goto spin_unlock;
1092 1092
1093 seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno; 1093 seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno;