[commits] [linux-merge]linux integration; branch, merge/master, updated. v3.7-rc1-1513-g889a479

postmaster at open-mesh.org postmaster at open-mesh.org
Mon Oct 15 09:37:08 CEST 2012


The following commit has been merged in the merge/master branch:
commit dec7a30b71cfba8fb8323cc1ed8ea7a49daead50
Author: Linus Lüssing <linus.luessing at web.de>
Date:   Fri Sep 14 00:40:54 2012 +0000

    batman-adv: make batadv_test_bit() return 0 or 1 only
    
    On some architectures test_bit() can return other values than 0 or 1:
    
    With a generic x86 OpenWrt image in a kvm setup (batadv_)test_bit()
    frequently returns -1 for me, leading to batadv_iv_ogm_update_seqnos()
    wrongly signaling a protected seqno window.
    
    This patch tries to fix this issue by making batadv_test_bit() return 0
    or 1 only.
    
    Signed-off-by: Linus Lüssing <linus.luessing at web.de>
    Acked-by: Sven Eckelmann <sven at narfation.org>
    Signed-off-by: Antonio Quartulli <ordex at autistici.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h
index a081ce1..cebaae7 100644
--- a/net/batman-adv/bitarray.h
+++ b/net/batman-adv/bitarray.h
@@ -20,8 +20,8 @@
 #ifndef _NET_BATMAN_ADV_BITARRAY_H_
 #define _NET_BATMAN_ADV_BITARRAY_H_
 
-/* returns true if the corresponding bit in the given seq_bits indicates true
- * and curr_seqno is within range of last_seqno
+/* Returns 1 if the corresponding bit in the given seq_bits indicates true
+ * and curr_seqno is within range of last_seqno. Otherwise returns 0.
  */
 static inline int batadv_test_bit(const unsigned long *seq_bits,
 				  uint32_t last_seqno, uint32_t curr_seqno)
@@ -32,7 +32,7 @@ static inline int batadv_test_bit(const unsigned long *seq_bits,
 	if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE)
 		return 0;
 	else
-		return  test_bit(diff, seq_bits);
+		return test_bit(diff, seq_bits) != 0;
 }
 
 /* turn corresponding bit on, so we can remember that we got the packet */

-- 
linux integration


More information about the commits mailing list