From: Anton Altaparmakov <aia21@cam.ac.uk>

x86_64 has incorrect include/asm-x86_64/bitops.h::ffs() implementation.  It
uses "g" instead of "rm" in the insline assembled bsfl instruction.  (This was
spotted by Yuri Per.)

bsfl does not accept constant values but only memory ones.  On i386 the
correct "rm" is used.

This causes NTFS build to fail as gcc optimizes a variable into a constant and
ffs() then fails to assemble.


---

 25-akpm/include/asm-x86_64/bitops.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN include/asm-x86_64/bitops.h~x86_64-has-buggy-ffs-implementation include/asm-x86_64/bitops.h
--- 25/include/asm-x86_64/bitops.h~x86_64-has-buggy-ffs-implementation	Wed May 12 15:59:37 2004
+++ 25-akpm/include/asm-x86_64/bitops.h	Wed May 12 15:59:37 2004
@@ -458,7 +458,7 @@ static __inline__ int ffs(int x)
 
 	__asm__("bsfl %1,%0\n\t"
 		"cmovzl %2,%0" 
-		: "=r" (r) : "g" (x), "r" (-1));
+		: "=r" (r) : "rm" (x), "r" (-1));
 	return r+1;
 }
 

_