summaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-12 12:24:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-21 12:23:02 +0100
commit262057db8d8af00d57e6d51dc1e67fa4a3eeed43 (patch)
treef9c01318ee773e01f431a2be2640c3253960b1ce /arch/arm/include
parentf98ecf9159fc136ead07b25a28fd4b4ad4f1c0c0 (diff)
downloadbarebox-262057db8d8af00d57e6d51dc1e67fa4a3eeed43.tar.gz
barebox-262057db8d8af00d57e6d51dc1e67fa4a3eeed43.tar.xz
ARM: Use generic ffz()
The generic ffz() from <asm-generic/bitops/ffz.h> works like our ARM specific variant except that the generic variant has 64bit word size support. Use the generic variant to fix ffz() for aarch64. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/bitops.h18
1 files changed, 1 insertions, 17 deletions
diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index b51225efe5..344e288bae 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -156,23 +156,7 @@ static inline int constant_fls(int x)
#define __ffs(x) (ffs(x) - 1)
#define ffz(x) __ffs(~(x))
#else /* ! __ARM__USE_GENERIC_FF */
-/*
- * ffz = Find First Zero in word. Undefined if no zero exists,
- * so code should check against ~0UL first..
- */
-static inline unsigned long ffz(unsigned long word)
-{
- int k;
-
- word = ~word;
- k = 31;
- if (word & 0x0000ffff) { k -= 16; word <<= 16; }
- if (word & 0x00ff0000) { k -= 8; word <<= 8; }
- if (word & 0x0f000000) { k -= 4; word <<= 4; }
- if (word & 0x30000000) { k -= 2; word <<= 2; }
- if (word & 0x40000000) { k -= 1; }
- return k;
-}
+#include <asm-generic/bitops/ffz.h>
#include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/fls.h>