diff options
Diffstat (limited to 'net/batman-adv/bitarray.h')
-rw-r--r-- | net/batman-adv/bitarray.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/net/batman-adv/bitarray.h b/net/batman-adv/bitarray.h index 3e41bb80eb81..0e6e9d09078c 100644 --- a/net/batman-adv/bitarray.h +++ b/net/batman-adv/bitarray.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <linux/bitops.h> | 23 | #include <linux/bitops.h> |
24 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
25 | #include <linux/stddef.h> | ||
25 | #include <linux/types.h> | 26 | #include <linux/types.h> |
26 | 27 | ||
27 | /** | 28 | /** |
@@ -31,17 +32,17 @@ | |||
31 | * @last_seqno: latest sequence number in seq_bits | 32 | * @last_seqno: latest sequence number in seq_bits |
32 | * @curr_seqno: sequence number to test for | 33 | * @curr_seqno: sequence number to test for |
33 | * | 34 | * |
34 | * Return: 1 if the corresponding bit in the given seq_bits indicates true | 35 | * Return: true if the corresponding bit in the given seq_bits indicates true |
35 | * and curr_seqno is within range of last_seqno. Otherwise returns 0. | 36 | * and curr_seqno is within range of last_seqno. Otherwise returns false. |
36 | */ | 37 | */ |
37 | static inline int batadv_test_bit(const unsigned long *seq_bits, | 38 | static inline bool batadv_test_bit(const unsigned long *seq_bits, |
38 | u32 last_seqno, u32 curr_seqno) | 39 | u32 last_seqno, u32 curr_seqno) |
39 | { | 40 | { |
40 | s32 diff; | 41 | s32 diff; |
41 | 42 | ||
42 | diff = last_seqno - curr_seqno; | 43 | diff = last_seqno - curr_seqno; |
43 | if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) | 44 | if (diff < 0 || diff >= BATADV_TQ_LOCAL_WINDOW_SIZE) |
44 | return 0; | 45 | return false; |
45 | return test_bit(diff, seq_bits) != 0; | 46 | return test_bit(diff, seq_bits) != 0; |
46 | } | 47 | } |
47 | 48 | ||
@@ -55,7 +56,7 @@ static inline void batadv_set_bit(unsigned long *seq_bits, s32 n) | |||
55 | set_bit(n, seq_bits); /* turn the position on */ | 56 | set_bit(n, seq_bits); /* turn the position on */ |
56 | } | 57 | } |
57 | 58 | ||
58 | int batadv_bit_get_packet(void *priv, unsigned long *seq_bits, s32 seq_num_diff, | 59 | bool batadv_bit_get_packet(void *priv, unsigned long *seq_bits, |
59 | int set_mark); | 60 | s32 seq_num_diff, int set_mark); |
60 | 61 | ||
61 | #endif /* _NET_BATMAN_ADV_BITARRAY_H_ */ | 62 | #endif /* _NET_BATMAN_ADV_BITARRAY_H_ */ |