summaryrefslogtreecommitdiffstats
path: root/include/linux/bitops_compat.c
blob: 8e1e25809a4555e779a1d8845fdd0d518894c748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _SPL_BITOPS_COMPAT_H
#define _SPL_BITOPS_COMPAT_H

#include <linux/bitops.h>

#ifndef HAVE_FLS64

static inline int fls64(__u64 x)
{
       __u32 h = x >> 32;
       if (h)
               return fls(h) + 32;
       return fls(x);
}

#endif /* HAVE_FLS64 */

#endif /* _SPL_BITOPS_COMPAT_H */