The shift assignment in the last if block of ffs/fls is never read, remove it. Found using clang scan-build. Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx> --- include/asm-generic/bitops/ffs.h | 4 +--- include/asm-generic/bitops/fls.h | 4 +--- tools/include/asm-generic/bitops/fls.h | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/include/asm-generic/bitops/ffs.h b/include/asm-generic/bitops/ffs.h index e81868b2c0f0..bc5f1a8f83ca 100644 --- a/include/asm-generic/bitops/ffs.h +++ b/include/asm-generic/bitops/ffs.h @@ -32,10 +32,8 @@ static inline int ffs(int x) x >>= 2; r += 2; } - if (!(x & 1)) { - x >>= 1; + if (!(x & 1)) r += 1; - } return r; } diff --git a/include/asm-generic/bitops/fls.h b/include/asm-generic/bitops/fls.h index b168bb10e1be..07e5cdfc3b98 100644 --- a/include/asm-generic/bitops/fls.h +++ b/include/asm-generic/bitops/fls.h @@ -32,10 +32,8 @@ static __always_inline int fls(unsigned int x) x <<= 2; r -= 2; } - if (!(x & 0x80000000u)) { - x <<= 1; + if (!(x & 0x80000000u)) r -= 1; - } return r; } diff --git a/tools/include/asm-generic/bitops/fls.h b/tools/include/asm-generic/bitops/fls.h index b168bb10e1be..07e5cdfc3b98 100644 --- a/tools/include/asm-generic/bitops/fls.h +++ b/tools/include/asm-generic/bitops/fls.h @@ -32,10 +32,8 @@ static __always_inline int fls(unsigned int x) x <<= 2; r -= 2; } - if (!(x & 0x80000000u)) { - x <<= 1; + if (!(x & 0x80000000u)) r -= 1; - } return r; } -- 2.27.0