From 0079d2cef1514422668c7beedd61bfde5aa2c146 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Sat, 4 Feb 2012 17:34:52 +0100 Subject: 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 Signed-off-by: Antonio Quartulli --- net/batman-adv/routing.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net/batman-adv/routing.c') diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 7f8e15899417..b0370e3c59e8 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -52,7 +52,7 @@ void slide_own_bcast_window(struct hard_iface *hard_iface) bit_get_packet(bat_priv, word, 1, 0); orig_node->bcast_own_sum[hard_iface->if_num] = - bit_packet_count(word); + bitmap_weight(word, TQ_LOCAL_WINDOW_SIZE); spin_unlock_bh(&orig_node->ogm_cnt_lock); } rcu_read_unlock(); @@ -1047,8 +1047,8 @@ int recv_bcast_packet(struct sk_buff *skb, struct hard_iface *recv_if) spin_lock_bh(&orig_node->bcast_seqno_lock); /* check whether the packet is a duplicate */ - if (get_bit_status(orig_node->bcast_bits, orig_node->last_bcast_seqno, - ntohl(bcast_packet->seqno))) + if (bat_test_bit(orig_node->bcast_bits, orig_node->last_bcast_seqno, + ntohl(bcast_packet->seqno))) goto spin_unlock; seq_diff = ntohl(bcast_packet->seqno) - orig_node->last_bcast_seqno; -- cgit v1.2.1