[PATCH 19/78] ARM: aarch64: Do not use 32bit optimized fls

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 16 05:52:55 PDT 2018


The clz operation only works with 32bit values, so use the generic
fls() variants on aarch64. With this tlsf_malloc works as expected.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/include/asm/bitops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/bitops.h b/arch/arm/include/asm/bitops.h
index cd356c5e3d..348a76b2c1 100644
--- a/arch/arm/include/asm/bitops.h
+++ b/arch/arm/include/asm/bitops.h
@@ -115,7 +115,7 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
 
 #endif		/* __ARMEB__ */
 
-#if defined(__LINUX_ARM_ARCH__) && (__LINUX_ARM_ARCH__ >= 5)
+#if defined (CONFIG_CPU_32) && defined(__LINUX_ARM_ARCH__) && (__LINUX_ARM_ARCH__ >= 5)
 static inline int constant_fls(int x)
 {
 	int r = 32;
-- 
2.16.1




More information about the barebox mailing list