aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/linux/kernel.h
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2016-12-14 18:08:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 19:04:10 -0500
commit0629573e6bbd60f20ed2d7a91da1214a6274e751 (patch)
treeaed29e29406c6250a834586b2a45f84152db7c80 /tools/testing/radix-tree/linux/kernel.h
parentb328daf3b7130098b105c18bdae694ddaad5b6e3 (diff)
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. Link: http://lkml.kernel.org/r/1480369871-5271-48-git-send-email-mawilcox@linuxonhyperv.com Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Tested-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Matthew Wilcox <mawilcox@microsoft.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/testing/radix-tree/linux/kernel.h')
-rw-r--r--tools/testing/radix-tree/linux/kernel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
index dbe4b92806b8..23e77f5673ce 100644
--- a/tools/testing/radix-tree/linux/kernel.h
+++ b/tools/testing/radix-tree/linux/kernel.h
@@ -47,4 +47,15 @@ static inline int in_interrupt(void)
47{ 47{
48 return 0; 48 return 0;
49} 49}
50
51/*
52 * This looks more complex than it should be. But we need to
53 * get the type for the ~ right in round_down (it needs to be
54 * as wide as the result!), and we want to evaluate the macro
55 * arguments just once each.
56 */
57#define __round_mask(x, y) ((__typeof__(x))((y)-1))
58#define round_up(x, y) ((((x)-1) | __round_mask(x, y))+1)
59#define round_down(x, y) ((x) & ~__round_mask(x, y))
60
50#endif /* _KERNEL_H */ 61#endif /* _KERNEL_H */