Message ID | 20240710202416.710880-3-thorsten.blum@toblux.com (mailing list archive) |
---|---|
State | Accepted |
Commit | fb9086e95ad84f14e4f4db97ed96422c74407830 |
Headers | show |
Series | riscv: Remove unnecessary int cast in variable_fls() | expand |
On Wed, Jul 10, 2024 at 10:24:18PM +0200, Thorsten Blum wrote: > __builtin_clz() returns an int and casting the whole expression to int > is unnecessary. Remove it. > > Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Added in bitmap-for-next for testing. Thanks, Yury > --- > arch/riscv/include/asm/bitops.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h > index 880606b0469a..71af9ecfcfcb 100644 > --- a/arch/riscv/include/asm/bitops.h > +++ b/arch/riscv/include/asm/bitops.h > @@ -170,7 +170,7 @@ static __always_inline int variable_fls(unsigned int x) > ({ \ > typeof(x) x_ = (x); \ > __builtin_constant_p(x_) ? \ > - (int)((x_ != 0) ? (32 - __builtin_clz(x_)) : 0) \ > + ((x_ != 0) ? (32 - __builtin_clz(x_)) : 0) \ > : \ > variable_fls(x_); \ > }) > -- > 2.45.2
Hello: This patch was applied to riscv/linux.git (fixes) by Yury Norov <yury.norov@gmail.com>: On Wed, 10 Jul 2024 22:24:18 +0200 you wrote: > __builtin_clz() returns an int and casting the whole expression to int > is unnecessary. Remove it. > > Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> > --- > arch/riscv/include/asm/bitops.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Here is the summary with links: - riscv: Remove unnecessary int cast in variable_fls() https://git.kernel.org/riscv/c/fb9086e95ad8 You are awesome, thank you!
diff --git a/arch/riscv/include/asm/bitops.h b/arch/riscv/include/asm/bitops.h index 880606b0469a..71af9ecfcfcb 100644 --- a/arch/riscv/include/asm/bitops.h +++ b/arch/riscv/include/asm/bitops.h @@ -170,7 +170,7 @@ static __always_inline int variable_fls(unsigned int x) ({ \ typeof(x) x_ = (x); \ __builtin_constant_p(x_) ? \ - (int)((x_ != 0) ? (32 - __builtin_clz(x_)) : 0) \ + ((x_ != 0) ? (32 - __builtin_clz(x_)) : 0) \ : \ variable_fls(x_); \ })
__builtin_clz() returns an int and casting the whole expression to int is unnecessary. Remove it. Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> --- arch/riscv/include/asm/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)