Skip to contentSkip to conversation

radix-tree-test-suite-use-common-find-bit-code.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 15, 2016

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: radix tree test suite: use common find-bit code
has been removed from the -mm tree. Its filename was
radix-tree-test-suite-use-common-find-bit-code.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Matthew Wilcox <[email protected]>
Subject: radix tree test suite: use common find-bit code

Remove the old find_next_bit code in favour of linking in the find_bit code from tools/lib.

---

 tools/testing/radix-tree/Makefile                  |    7 +
 tools/testing/radix-tree/find_next_bit.c           |   57 -----------
 tools/testing/radix-tree/linux/bitops.h            |   42 +++++---
 tools/testing/radix-tree/linux/bitops/non-atomic.h |   13 +-
 tools/testing/radix-tree/linux/kernel.h            |   11 ++
 5 files changed, 49 insertions(+), 81 deletions(-)
tools/testing/radix-tree/Makefile renamed from tools/testing/radix-tree/Makefile~radix-tree-test-suite-use-common-find-bit-code +6 -1
diff -puN tools/testing/radix-tree/Makefile~radix-tree-test-suite-use-common-find-bit-code tools/testing/radix-tree/Makefile
@@ -18,7 +18,12 @@ main:	$(OFILES)
 clean:
 	$(RM) -f $(TARGETS) *.o radix-tree.c
 
-$(OFILES): *.h */*.h ../../../include/linux/radix-tree.h ../../include/linux/*.h
+find_next_bit.o: ../../lib/find_bit.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+$(OFILES): *.h */*.h \
+	../../include/linux/*.h \
+	../../../include/linux/radix-tree.h
 
 radix-tree.c: ../../../lib/radix-tree.c
 	sed -e 's/^static //' -e 's/__always_inline //' -e 's/inline //' < $< > $@
tools/testing/radix-tree/find_next_bit.c deleted +0 -57

57 lines not on this page · raw message

tools/testing/radix-tree/linux/bitops.h renamed from tools/testing/radix-tree/linux/bitops.h~radix-tree-test-suite-use-common-find-bit-code +26 -16

94 lines not on this page · raw message

tools/testing/radix-tree/linux/bitops/non-atomic.h renamed from tools/testing/radix-tree/linux/bitops/non-atomic.h~radix-tree-test-suite-use-common-find-bit-code +6 -7
diff -puN tools/testing/radix-tree/linux/bitops/non-atomic.h~radix-tree-test-suite-use-common-find-bit-code tools/testing/radix-tree/linux/bitops/non-atomic.h
@@ -3,7 +3,6 @@
 
 #include <asm/types.h>
 
-#define BITOP_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BITOP_WORD(nr)		((nr) / BITS_PER_LONG)
 
 /**
@@ -17,7 +16,7 @@
  */
 static inline void __set_bit(int nr, volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 
 	*p  |= mask;
@@ -25,7 +24,7 @@ static inline void __set_bit(int nr, vol
 
 static inline void __clear_bit(int nr, volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 
 	*p &= ~mask;
@@ -42,7 +41,7 @@ static inline void __clear_bit(int nr, v
  */
 static inline void __change_bit(int nr, volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 
 	*p ^= mask;
@@ -59,7 +58,7 @@ static inline void __change_bit(int nr,
  */
 static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 	unsigned long old = *p;
 
@@ -78,7 +77,7 @@ static inline int __test_and_set_bit(int
  */
 static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 	unsigned long old = *p;
 
@@ -90,7 +89,7 @@ static inline int __test_and_clear_bit(i
 static inline int __test_and_change_bit(int nr,
 					    volatile unsigned long *addr)
 {
-	unsigned long mask = BITOP_MASK(nr);
+	unsigned long mask = BIT_MASK(nr);
 	unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
 	unsigned long old = *p;
 
tools/testing/radix-tree/linux/kernel.h renamed from tools/testing/radix-tree/linux/kernel.h~radix-tree-test-suite-use-common-find-bit-code +11 -0
diff -puN tools/testing/radix-tree/linux/kernel.h~radix-tree-test-suite-use-common-find-bit-code tools/testing/radix-tree/linux/kernel.h
@@ -47,4 +47,15 @@ static inline int in_interrupt(void)
 {
 	return 0;
 }
+
+/*
+ * This looks more complex than it should be. But we need to
+ * get the type for the ~ right in round_down (it needs to be
+ * as wide as the result!), and we want to evaluate the macro
+ * arguments just once each.
+ */
+#define __round_mask(x, y) ((__typeof__(x))((y)-1))
+#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
+#define round_down(x, y) ((x) & ~__round_mask(x, y))
+
 #endif /* _KERNEL_H */

_

Patches currently in -mm which might be from [email protected] are

reimplement-idr-and-ida-using-the-radix-tree.patch