[PATCH] powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()
Michael Ellerman
patch-notifications at ellerman.id.au
Wed Nov 25 22:57:41 AEDT 2020
On Thu, 22 Oct 2020 14:05:46 +0000 (UTC), Christophe Leroy wrote:
> fls() and fls64() are using __builtin_ctz() and _builtin_ctzll().
> On powerpc, those builtins trivially use ctlzw and ctlzd power
> instructions.
>
> Allthough those instructions provide the expected result with
> input argument 0, __builtin_ctz() and __builtin_ctzll() are
> documented as undefined for value 0.
>
> [...]
Applied to powerpc/next.
[1/1] powerpc/bitops: Fix possible undefined behaviour with fls() and fls64()
https://git.kernel.org/powerpc/c/1891ef21d92c4801ea082ee8ed478e304ddc6749
cheers
More information about the Linuxppc-dev
mailing list