Commit fcd84f2f authored by Thomas Bogendoerfer's avatar Thomas Bogendoerfer Committed by Ralf Baechle

[MIPS] Fix __fls for non-MIPS32/MIPS64 cpus

Only MIPS32 and MIPS64 CPUs implement clz/dclz. Therefore don't export
__ilog2() for non MIPS32/MIPS64 cpus and use generic __fls bitop code for
these cpus.
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 7ff83f21
...@@ -558,6 +558,8 @@ static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long * ...@@ -558,6 +558,8 @@ static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *
__clear_bit(nr, addr); __clear_bit(nr, addr);
} }
#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
/* /*
* Return the bit position (0..63) of the most significant 1 bit in a word * Return the bit position (0..63) of the most significant 1 bit in a word
* Returns -1 if no 1 bit exists * Returns -1 if no 1 bit exists
...@@ -596,8 +598,6 @@ static inline unsigned long __fls(unsigned long x) ...@@ -596,8 +598,6 @@ static inline unsigned long __fls(unsigned long x)
return __ilog2(x); return __ilog2(x);
} }
#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
/* /*
* __ffs - find first bit in word. * __ffs - find first bit in word.
* @word: The word to search * @word: The word to search
...@@ -654,6 +654,7 @@ static inline int ffs(int word) ...@@ -654,6 +654,7 @@ static inline int ffs(int word)
#else #else
#include <asm-generic/bitops/__ffs.h> #include <asm-generic/bitops/__ffs.h>
#include <asm-generic/bitops/__fls.h>
#include <asm-generic/bitops/ffs.h> #include <asm-generic/bitops/ffs.h>
#include <asm-generic/bitops/fls.h> #include <asm-generic/bitops/fls.h>
#include <asm-generic/bitops/fls64.h> #include <asm-generic/bitops/fls64.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment