Displaying 2 results from an estimated 2 matches for "for_each_set_bit_from".
2013 Mar 11
1
[Bridge] [PATCH -next] bridge: using for_each_set_bit_from to simplify the code
From: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
Using for_each_set_bit_from() to simplify the code.
Signed-off-by: Wei Yongjun <yongjun_wei at trendmicro.com.cn>
---
net/bridge/br_fdb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index b0812c9..48fe761 100644
--- a/net/bridge/br_fdb.c
+++ b/net/br...
2013 Apr 03
0
[PATCH] Btrfs-progs: add a free space cache checker to fsck
...(nr, BITS_PER_BYTE * sizeof(u32))
+
+#define for_each_set_bit(bit, addr, size) \
+ for ((bit) = find_first_bit((addr), (size)); \
+ (bit) < (size); \
+ (bit) = find_next_bit((addr), (size), (bit) + 1))
+
+/* same as for_each_set_bit() but use bit as value to start with */
+#define for_each_set_bit_from(bit, addr, size) \
+ for ((bit) = find_next_bit((addr), (size), (bit)); \
+ (bit) < (size); \
+ (bit) = find_next_bit((addr), (size), (bit) + 1))
+
+static inline void set_bit(int nr, unsigned long *addr)
+{
+ addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);
+}
+
+sta...