[igt-dev] [PATCH i-g-t 20/29] ilog2: Use libc provided fls() on FreeBSD

D Scott Phillips d.scott.phillips at intel.com
Wed Dec 11 00:52:26 UTC 2019


FreeBSD's libc provides an fls() function with the same name and
behavior, so simply omit our version on FreeBSD.

Signed-off-by: D Scott Phillips <d.scott.phillips at intel.com>
---
 benchmarks/ilog2.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/benchmarks/ilog2.h b/benchmarks/ilog2.h
index 596d7c23..c7d18094 100644
--- a/benchmarks/ilog2.h
+++ b/benchmarks/ilog2.h
@@ -3,12 +3,14 @@
 
 #include <stdint.h>
 
+#if !defined(__FreeBSD__)
 static inline int fls(int x)
 {
         int r = -1;
         asm("bsrl %1,%0" : "=r" (r) : "rm" (x), "0" (-1));
         return r + 1;
 }
+#endif
 
 static inline int fls64(__u64 x)
 {
-- 
2.23.0



More information about the igt-dev mailing list