builtin-ffs.h 371 B

1234567891011121314151617
  1. #ifndef _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_
  2. #define _ASM_GENERIC_BITOPS_BUILTIN_FFS_H_
  3. /**
  4. * ffs - find first bit set
  5. * @x: the word to search
  6. *
  7. * This is defined the same way as
  8. * the libc and compiler builtin ffs routines, therefore
  9. * differs in spirit from the above ffz (man ffs).
  10. */
  11. static __always_inline int ffs(int x)
  12. {
  13. return __builtin_ffs(x);
  14. }
  15. #endif