/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_GENERIC_BITOPS_FLS_H_ #define _ASM_GENERIC_BITOPS_FLS_H_ /** * fls - find last (most-significant) bit set * @x: the word to search * * This is defined the same way as ffs. * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32. */ static __always_inline int fls(int x) { int r = 32; if (!x) return 0; if (!(x & 0xffff0000u)) { x <<= 16; r -= 16; } if (!(x & 0xff000000u)) { x <<= 8; r -= 8; } if (!(x & 0xf0000000u)) { x <<= 4; r -= 4; } if (!(x & 0xc0000000u)) { x <<= 2; r -= 2; } if (!(x & 0x80000000u)) { x <<= 1; r -= 1; } return r; } #endif /* _ASM_GENERIC_BITOPS_FLS_H_ */
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__ffs.h | File | 777 B | 0644 |
|
__fls.h | File | 920 B | 0644 |
|
arch_hweight.h | File | 555 B | 0644 |
|
atomic.h | File | 5.5 KB | 0644 |
|
builtin-__ffs.h | File | 379 B | 0644 |
|
builtin-__fls.h | File | 436 B | 0644 |
|
builtin-ffs.h | File | 410 B | 0644 |
|
builtin-fls.h | File | 403 B | 0644 |
|
const_hweight.h | File | 1.67 KB | 0644 |
|
ext2-atomic-setbit.h | File | 403 B | 0644 |
|
ext2-atomic.h | File | 600 B | 0644 |
|
ffs.h | File | 654 B | 0644 |
|
ffz.h | File | 325 B | 0644 |
|
find.h | File | 1.94 KB | 0644 |
|
fls.h | File | 674 B | 0644 |
|
fls64.h | File | 860 B | 0644 |
|
hweight.h | File | 254 B | 0644 |
|
le.h | File | 2.19 KB | 0644 |
|
lock.h | File | 1.23 KB | 0644 |
|
non-atomic.h | File | 3 KB | 0644 |
|
sched.h | File | 760 B | 0644 |
|