linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Tue, 12 Jul 2005 15:53:05 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/07/12 15:52:51

Modified files:
        include/asm-mips: bitops.h 

Log message:
        Who stole my ffz ...

diff -urN linux/include/asm-mips/bitops.h linux/include/asm-mips/bitops.h
--- linux/include/asm-mips/bitops.h     2005/07/12 12:50:30     1.61
+++ linux/include/asm-mips/bitops.h     2005/07/12 14:52:51     1.62
@@ -629,11 +629,24 @@
 
 static inline unsigned long ffs(unsigned long word)
 {
-       if (!word) return 0;
+       if (!word)
+               return 0;
+
        return __ffs(word) + 1;
 }
 
 /*
+ * ffz - find first zero in word.
+ * @word: The word to search
+ *
+ * Undefined if no zero exists, so code should check against ~0UL first.
+ */
+static inline unsigned long ffz(unsigned long word)
+{
+       return __ffs (~word);
+}
+
+/*
  * flz - find last zero in word.
  * @word: The word to search
  *

<Prev in Thread] Current Thread [Next in Thread>