]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - include/bitops.h
5 * fls: find last bit set.
9 static inline int fls(int x
)
15 if (!(x
& 0xffff0000u
)) {
19 if (!(x
& 0xff000000u
)) {
23 if (!(x
& 0xf0000000u
)) {
27 if (!(x
& 0xc0000000u
)) {
31 if (!(x
& 0x80000000u
)) {
38 static inline int fls64(__u64 x
)
46 static inline unsigned fls_long(unsigned long l
)
54 * ffz: find first zero bit.
55 * Result is undefined if no zero bit exists.
57 #define ffz(x) ffs(~(x))