linux-mips
[Top] [All Lists]

[2.5 PATCH] __ffs implementation

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: [2.5 PATCH] __ffs implementation
From: Vivien Chappelier <vivien.chappelier@enst-bretagne.fr>
Date: Fri, 12 Jul 2002 00:39:54 +0200 (CEST)
Cc: linux-mips@oss.sgi.com
Sender: owner-linux-mips@oss.sgi.com
Hi,

        Fixes __ffs(x) implementation for the 2.5.4 kernel on mips and
mips64 : ffz(~x) instead of ffz(x).

Vivien.

--- linux/include/asm-mips/bitops.h     Mon Jul  8 22:28:08 2002
+++ linux.patch/include/asm-mips/bitops.h       Fri Jul 12 00:04:26 2002
@@ -732,7 +732,7 @@
  */
 static __inline__ unsigned long __ffs(unsigned long word)
 {
-       return ffz(word);
+       return ffz(~word);
 }
 
 #ifdef __KERNEL__
--- linux/include/asm-mips64/bitops.h   Wed Jul 10 00:30:31 2002
+++ linux.patch/include/asm-mips64/bitops.h     Fri Jul 12 00:04:13 2002
@@ -444,7 +444,7 @@
  */
 static __inline__ unsigned long __ffs(unsigned long word)
 {
-       return ffz(word);
+       return ffz(~word);
 }
 
 /*


<Prev in Thread] Current Thread [Next in Thread>
  • [2.5 PATCH] __ffs implementation, Vivien Chappelier <=