eal: fix argument in 32-bit safe BSF function
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 23 Jul 2021 15:45:46 +0000 (08:45 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Sat, 24 Jul 2021 07:51:30 +0000 (09:51 +0200)
commit128c22b9980fd032629f46fa15ec6a2024ced399
tree9c8cad84013a4139cdeb0bb21d041c8fe31eeb89
parent73b91412ca5f7c5d1bb97e6fcc608afed19b25ef
eal: fix argument in 32-bit safe BSF function

The first argument to rte_bsf32_safe was incorrectly declared as
a 64 bit value. The code only works on 32 bit values and the underlying
function rte_bsf32 only accepts 32 bit values. This was a mistake
introduced when the safe version was added and probably cause
by copy/paste from the 64 bit version.

The bug passed silently under the radar until some other code was
built with -Wall and -Wextra in C++ and C++ complains about the
missing cast.

Yes, this is a API signature change, but the original code was wrong.
It is an inline so not an ABI change.

Fixes: 4e261f551986 ("eal: add 64-bit bsf and 32-bit safe bsf functions")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
doc/guides/rel_notes/release_21_08.rst
lib/eal/include/rte_common.h