aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-02-04 11:34:52 -0500
committerAntonio Quartulli <ordex@autistici.org>2012-04-11 08:28:58 -0400
commit0079d2cef1514422668c7beedd61bfde5aa2c146 (patch)
tree64d118360835eb1abfa9546ce3cac99c8db9ce79 /net/batman-adv/bat_iv_ogm.c
parentc1faead3335608d9c9bb58e07bbf9663d53d4b26 (diff)
batman-adv: Replace bitarray operations with bitmap
bitarray.c consists mostly of functionality that is already available as part of the standard kernel API. batman-adv could use architecture optimized code and reduce the binary size by switching to the standard functions. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/bat_iv_ogm.c')
-rw-r--r--net/batman-adv/bat_iv_ogm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index a6d5d63fb6ad..fab1071f601e 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -850,9 +850,9 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
850 hlist_for_each_entry_rcu(tmp_neigh_node, node, 850 hlist_for_each_entry_rcu(tmp_neigh_node, node,
851 &orig_node->neigh_list, list) { 851 &orig_node->neigh_list, list) {
852 852
853 is_duplicate |= get_bit_status(tmp_neigh_node->real_bits, 853 is_duplicate |= bat_test_bit(tmp_neigh_node->real_bits,
854 orig_node->last_real_seqno, 854 orig_node->last_real_seqno,
855 batman_ogm_packet->seqno); 855 batman_ogm_packet->seqno);
856 856
857 if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) && 857 if (compare_eth(tmp_neigh_node->addr, ethhdr->h_source) &&
858 (tmp_neigh_node->if_incoming == if_incoming)) 858 (tmp_neigh_node->if_incoming == if_incoming))
@@ -866,7 +866,8 @@ static int bat_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
866 seq_diff, set_mark); 866 seq_diff, set_mark);
867 867
868 tmp_neigh_node->real_packet_count = 868 tmp_neigh_node->real_packet_count =
869 bit_packet_count(tmp_neigh_node->real_bits); 869 bitmap_weight(tmp_neigh_node->real_bits,
870 TQ_LOCAL_WINDOW_SIZE);
870 } 871 }
871 rcu_read_unlock(); 872 rcu_read_unlock();
872 873
@@ -998,11 +999,11 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
998 999
999 spin_lock_bh(&orig_neigh_node->ogm_cnt_lock); 1000 spin_lock_bh(&orig_neigh_node->ogm_cnt_lock);
1000 word = &(orig_neigh_node->bcast_own[offset]); 1001 word = &(orig_neigh_node->bcast_own[offset]);
1001 bit_mark(word, 1002 bat_set_bit(word,
1002 if_incoming_seqno - 1003 if_incoming_seqno -
1003 batman_ogm_packet->seqno - 2); 1004 batman_ogm_packet->seqno - 2);
1004 orig_neigh_node->bcast_own_sum[if_incoming->if_num] = 1005 orig_neigh_node->bcast_own_sum[if_incoming->if_num] =
1005 bit_packet_count(word); 1006 bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE);
1006 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); 1007 spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock);
1007 } 1008 }
1008 1009