[PATCH] eal: fix return type of bsf safe functions
Thomas Monjalon
thomas at monjalon.net
Wed Oct 5 17:40:36 CEST 2022
In a recent commit, changing return type from int to uint32_t,
I did a last minute change to functions rte_bsf32_safe and rte_bsf64_safe,
because thought they were forgotten.
Actually these functions are returning 0 or 1, so it should be int.
The return type is reverted to the original type for these 2 functions.
Fixes: 4b81c145ae37 ("eal: change return type of bsf/fls functions")
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
---
lib/eal/include/rte_common.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
index 23d9e05cbb..15765b408d 100644
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -660,7 +660,7 @@ rte_bsf32(uint32_t v)
* @return
* Returns 0 if ``v`` was 0, otherwise returns 1.
*/
-static inline uint32_t
+static inline int
rte_bsf32_safe(uint32_t v, uint32_t *pos)
{
if (v == 0)
@@ -739,7 +739,7 @@ rte_bsf64(uint64_t v)
* @return
* Returns 0 if ``v`` was 0, otherwise returns 1.
*/
-static inline uint32_t
+static inline int
rte_bsf64_safe(uint64_t v, uint32_t *pos)
{
if (v == 0)
--
2.36.1
More information about the dev
mailing list