diff options
author | Brian Behlendorf <[email protected]> | 2014-09-30 18:07:07 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-10-17 15:11:50 -0700 |
commit | 87f8055a91940e6408420091e1a1601113f7912e (patch) | |
tree | a86d510d856546a22fdb0c9aa22c6dacdf00ec35 /include | |
parent | 9c91800d199c65c7d893445bae9b9a9a5590c335 (diff) |
Map highbit64() to fls64()
The fls64() function has been available since Linux 2.6.16 and
it should be used to implemented highbit64(). This allows us
to provide an optimized implementation and simplify the code.
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bitops_compat.h | 12 | ||||
-rw-r--r-- | include/sys/sysmacros.h | 5 |
2 files changed, 2 insertions, 15 deletions
diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h index 9c55844ad..0a3ac16f4 100644 --- a/include/linux/bitops_compat.h +++ b/include/linux/bitops_compat.h @@ -27,17 +27,5 @@ #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 */ diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 33e92b6d8..c56d7e12a 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -152,13 +152,12 @@ extern char spl_version[32]; extern unsigned long spl_hostid; /* Missing misc functions */ -extern int highbit(unsigned long i); -extern int highbit64(uint64_t i); extern uint32_t zone_get_hostid(void *zone); extern void spl_setup(void); extern void spl_cleanup(void); -#define makedevice(maj,min) makedev(maj,min) +#define highbit64(x) fls64(x) +#define makedevice(maj,min) makedev(maj,min) /* common macros */ #ifndef MIN |