diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-11 20:09:25 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 16:15:16 -0400 |
commit | 0f5f9322681887ca221707afafe4216b6db5d22f (patch) | |
tree | 93a654d6a5433adedeaee26cd204ad4b338304b1 /net | |
parent | 5853e22c58b318232fd6e15033ccb0852f865c0b (diff) |
batman-adv: Prefix bitarray non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/bat_iv_ogm.c | 6 | ||||
-rw-r--r-- | net/batman-adv/bitarray.c | 8 | ||||
-rw-r--r-- | net/batman-adv/bitarray.h | 4 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index b44573903264..53bce95e5f33 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c | |||
@@ -903,9 +903,9 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr, | |||
903 | set_mark = 0; | 903 | set_mark = 0; |
904 | 904 | ||
905 | /* if the window moved, set the update flag. */ | 905 | /* if the window moved, set the update flag. */ |
906 | need_update |= bit_get_packet(bat_priv, | 906 | need_update |= batadv_bit_get_packet(bat_priv, |
907 | tmp_neigh_node->real_bits, | 907 | tmp_neigh_node->real_bits, |
908 | seq_diff, set_mark); | 908 | seq_diff, set_mark); |
909 | 909 | ||
910 | tmp_neigh_node->real_packet_count = | 910 | tmp_neigh_node->real_packet_count = |
911 | bitmap_weight(tmp_neigh_node->real_bits, | 911 | bitmap_weight(tmp_neigh_node->real_bits, |
diff --git a/net/batman-adv/bitarray.c b/net/batman-adv/bitarray.c index 07ae6e1b8aca..99ed9917ff0d 100644 --- a/net/batman-adv/bitarray.c +++ b/net/batman-adv/bitarray.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
26 | 26 | ||
27 | /* shift the packet array by n places. */ | 27 | /* shift the packet array by n places. */ |
28 | static void bat_bitmap_shift_left(unsigned long *seq_bits, int32_t n) | 28 | static void batadv_bitmap_shift_left(unsigned long *seq_bits, int32_t n) |
29 | { | 29 | { |
30 | if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE) | 30 | if (n <= 0 || n >= TQ_LOCAL_WINDOW_SIZE) |
31 | return; | 31 | return; |
@@ -40,8 +40,8 @@ static void bat_bitmap_shift_left(unsigned long *seq_bits, int32_t n) | |||
40 | * 1 if the window was moved (either new or very old) | 40 | * 1 if the window was moved (either new or very old) |
41 | * 0 if the window was not moved/shifted. | 41 | * 0 if the window was not moved/shifted. |
42 | */ | 42 | */ |
43 | int bit_get_packet(void *priv, unsigned long *seq_bits, | 43 | int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, |
44 | int32_t seq_num_diff, int set_mark) | 44 | int32_t seq_num_diff, int set_mark) |
45 | { | 45 | { |
46 | struct bat_priv *bat_priv = priv; | 46 | struct bat_priv *bat_priv = priv; |
47 | 47 | ||
@@ -58,7 +58,7 @@ int bit_get_packet(void *priv, unsigned long *seq_bits, | |||
58 | * set the mark if required */ | 58 | * set the mark if required */ |
59 | 59 | ||
60 | if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) { | 60 | if ((seq_num_diff > 0) && (seq_num_diff < TQ_LOCAL_WINDOW_SIZE)) { |
61 | bat_bitmap_shift_left(seq_bits, seq_num_diff); | 61 | batadv_bitmap_shift_left(seq_bits, seq_num_diff); |
62 | 62 | ||
63 | if (set_mark) | 63 | if (set_mark) |
64 | bat_set_bit(seq_bits, 0); | 64 | bat_set_bit(seq_bits, 0); |
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h index 1835c15cda41..e855ddd37430 100644 --- a/net/batman-adv/bitarray.h +++ b/net/batman-adv/bitarray.h | |||
@@ -48,7 +48,7 @@ static inline void bat_set_bit(unsigned long *seq_bits, int32_t n) | |||
48 | 48 | ||
49 | /* receive and process one packet, returns 1 if received seq_num is considered | 49 | /* receive and process one packet, returns 1 if received seq_num is considered |
50 | * new, 0 if old */ | 50 | * new, 0 if old */ |
51 | int bit_get_packet(void *priv, unsigned long *seq_bits, | 51 | int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, |
52 | int32_t seq_num_diff, int set_mark); | 52 | int32_t seq_num_diff, int set_mark); |
53 | 53 | ||
54 | #endif /* _NET_BATMAN_ADV_BITARRAY_H_ */ | 54 | #endif /* _NET_BATMAN_ADV_BITARRAY_H_ */ |
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 9cfd23c6d64a..e573c32a619d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -54,7 +54,7 @@ void slide_own_bcast_window(struct hard_iface *hard_iface) | |||
54 | word_index = hard_iface->if_num * NUM_WORDS; | 54 | word_index = hard_iface->if_num * NUM_WORDS; |
55 | word = &(orig_node->bcast_own[word_index]); | 55 | word = &(orig_node->bcast_own[word_index]); |
56 | 56 | ||
57 | bit_get_packet(bat_priv, word, 1, 0); | 57 | batadv_bit_get_packet(bat_priv, word, 1, 0); |
58 | orig_node->bcast_own_sum[hard_iface->if_num] = | 58 | orig_node->bcast_own_sum[hard_iface->if_num] = |
59 | bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE); | 59 | bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE); |
60 | spin_unlock_bh(&orig_node->ogm_cnt_lock); | 60 | spin_unlock_bh(&orig_node->ogm_cnt_lock); |
@@ -1083,7 +1083,7 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) | |||
1083 | 1083 | ||
1084 | /* mark broadcast in flood history, update window position | 1084 | /* mark broadcast in flood history, update window position |
1085 | * if required. */ | 1085 | * if required. */ |
1086 | if (bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1)) | 1086 | if (batadv_bit_get_packet(bat_priv, orig_node->bcast_bits, seq_diff, 1)) |
1087 | orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno); | 1087 | orig_node->last_bcast_seqno = ntohl(bcast_packet->seqno); |
1088 | 1088 | ||
1089 | spin_unlock_bh(&orig_node->bcast_seqno_lock); | 1089 | spin_unlock_bh(&orig_node->bcast_seqno_lock); |