Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] Fix __fls for non mips32/mips64 cpus
@ 2008-05-03 22:25 Thomas Bogendoerfer
  2008-05-04 21:58 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Bogendoerfer @ 2008-05-03 22:25 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

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: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
---

 include/asm-mips/bitops.h |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index c2bd126..5e1f590 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -558,6 +558,8 @@ static inline void __clear_bit_unlock(unsigned long nr, volatile unsigned long *
 	__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
  * Returns -1 if no 1 bit exists
@@ -596,8 +598,6 @@ static inline unsigned long __fls(unsigned long x)
 	return __ilog2(x);
 }
 
-#if defined(CONFIG_CPU_MIPS32) || defined(CONFIG_CPU_MIPS64)
-
 /*
  * __ffs - find first bit in word.
  * @word: The word to search
@@ -654,6 +654,7 @@ static inline int ffs(int word)
 #else
 
 #include <asm-generic/bitops/__ffs.h>
+#include <asm-generic/bitops/__fls.h>
 #include <asm-generic/bitops/ffs.h>
 #include <asm-generic/bitops/fls.h>
 #include <asm-generic/bitops/fls64.h>

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-04 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-03 22:25 [PATCH] Fix __fls for non mips32/mips64 cpus Thomas Bogendoerfer
2008-05-04 21:58 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox