diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2012-09-12 22:06:22 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2012-09-14 14:53:05 +0100 |
commit | 8c39fdd6055b5cdb31b352c7ecad4cc719651597 (patch) | |
tree | 1545c21591682282e19f065d9a8ff9bb86580ef7 | |
parent | bb4838506f22175d14c41551c9049680ab7f94ff (diff) | |
download | linux-aarch64-8c39fdd6055b5cdb31b352c7ecad4cc719651597.tar.gz |
arm64: Use the generic builtin-* ffs/fls implementation
This patch removes the arm64-specific ffs/fls implementation and
includes the generic gcc builtins implementation.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r-- | arch/arm64/include/asm/bitops.h | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/arch/arm64/include/asm/bitops.h b/arch/arm64/include/asm/bitops.h index 67df4d2952d..5e693073b03 100644 --- a/arch/arm64/include/asm/bitops.h +++ b/arch/arm64/include/asm/bitops.h @@ -28,36 +28,15 @@ #define smp_mb__after_clear_bit() smp_mb() #endif -/* - * Use compiler builtins for simple inline operations. - */ -static inline unsigned long __ffs(unsigned long word) -{ - return __builtin_ffsl(word) - 1; -} - -static inline int ffs(int x) -{ - return __builtin_ffs(x); -} - -static inline unsigned long __fls(unsigned long word) -{ - return BITS_PER_LONG - 1 - __builtin_clzl(word); -} - -static inline int fls(int x) -{ - return x ? sizeof(x) * BITS_PER_BYTE - __builtin_clz(x) : 0; -} - -/* - * Mainly use the generic routines for now. - */ #ifndef _LINUX_BITOPS_H #error only <linux/bitops.h> can be included directly #endif +#include <asm-generic/bitops/builtin-__ffs.h> +#include <asm-generic/bitops/builtin-ffs.h> +#include <asm-generic/bitops/builtin-__fls.h> +#include <asm-generic/bitops/builtin-fls.h> + #include <asm-generic/bitops/ffz.h> #include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/find.h> |