riscv: Avoid code duplication with generic bitops implementation
[linux-2.6-microblaze.git] / include / asm-generic / bitops / ffs.h
index 323fd5d..4c43f24 100644 (file)
@@ -3,14 +3,14 @@
 #define _ASM_GENERIC_BITOPS_FFS_H_
 
 /**
- * ffs - find first bit set
+ * generic_ffs - find first bit set
  * @x: the word to search
  *
  * This is defined the same way as
  * the libc and compiler builtin ffs routines, therefore
  * differs in spirit from ffz (man ffs).
  */
-static inline int ffs(int x)
+static inline int generic_ffs(int x)
 {
        int r = 1;
 
@@ -39,4 +39,8 @@ static inline int ffs(int x)
        return r;
 }
 
+#ifndef __HAVE_ARCH_FFS
+#define ffs(x) generic_ffs(x)
+#endif
+
 #endif /* _ASM_GENERIC_BITOPS_FFS_H_ */