Staging
v0.5.1
https://github.com/torvalds/linux
Raw File
Tip revision: afd2ff9b7e1b367172f18ba7f693dfb62bdcb2dc authored by Linus Torvalds on 10 January 2016, 23:01:32 UTC
Linux 4.4
Tip revision: afd2ff9
builtin-__ffs.h
#ifndef _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_
#define _ASM_GENERIC_BITOPS_BUILTIN___FFS_H_

/**
 * __ffs - find first bit in word.
 * @word: The word to search
 *
 * Undefined if no bit exists, so code should check against 0 first.
 */
static __always_inline unsigned long __ffs(unsigned long word)
{
	return __builtin_ctzl(word);
}

#endif
back to top