summaryrefslogtreecommitdiffstats
path: root/tools/testing/radix-tree/linux/bitops/ffz.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/radix-tree/linux/bitops/ffz.h')
-rw-r--r--tools/testing/radix-tree/linux/bitops/ffz.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/testing/radix-tree/linux/bitops/ffz.h b/tools/testing/radix-tree/linux/bitops/ffz.h
new file mode 100644
index 0000000..6744bd4
--- /dev/null
+++ b/tools/testing/radix-tree/linux/bitops/ffz.h
@@ -0,0 +1,12 @@
+#ifndef _ASM_GENERIC_BITOPS_FFZ_H_
+#define _ASM_GENERIC_BITOPS_FFZ_H_
+
+/*
+ * ffz - find first zero in word.
+ * @word: The word to search
+ *
+ * Undefined if no zero exists, so code should check against ~0UL first.
+ */
+#define ffz(x) __ffs(~(x))
+
+#endif /* _ASM_GENERIC_BITOPS_FFZ_H_ */
OpenPOWER on IntegriCloud