include/asm-generic/bitops/fls.h
changeset 2 d1f6d8b6f81c
parent 0 aa628870c1d3
equal deleted inserted replaced
1:0056487c491e 2:d1f6d8b6f81c
     7  *
     7  *
     8  * This is defined the same way as ffs.
     8  * This is defined the same way as ffs.
     9  * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
     9  * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
    10  */
    10  */
    11 
    11 
    12 static inline int fls(int x)
    12 static __always_inline int fls(int x)
    13 {
    13 {
    14 	int r = 32;
    14 	int r = 32;
    15 
    15 
    16 	if (!x)
    16 	if (!x)
    17 		return 0;
    17 		return 0;