aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include/asm-generic/bitops/__ffz.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/asm-generic/bitops/__ffz.h')
-rw-r--r--tools/include/asm-generic/bitops/__ffz.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/include/asm-generic/bitops/__ffz.h b/tools/include/asm-generic/bitops/__ffz.h
new file mode 100644
index 000000000000..6744bd4cdf46
--- /dev/null
+++ b/tools/include/asm-generic/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_ */