diff mbox series

[2/3] eal: change rte_fls and rte_bsf to return uint32_t

Message ID 1659993692-17479-3-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers show
Series cleanup bsf and fls inline function return types | expand

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Tyler Retzlaff Aug. 8, 2022, 9:21 p.m. UTC
From: Tyler Retzlaff <roretzla@microsoft.com>

return fixed width uint32_t to be consistent with what appears to
be the original authors intent. it doesn't make much sense to return
signed integers for these functions.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/include/rte_common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
index a96cc2a..bd4184d 100644
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -707,7 +707,7 @@  static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  * @return
  *     The last (most-significant) bit set, or 0 if the input is 0.
  */
-static inline int
+static inline uint32_t
 rte_fls_u32(uint32_t x)
 {
 	return (x == 0) ? 0 : 32 - __builtin_clz(x);
@@ -724,7 +724,7 @@  static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  * @return
  *     least significant set bit in the input parameter.
  */
-static inline int
+static inline uint32_t
 rte_bsf64(uint64_t v)
 {
 	return (uint32_t)__builtin_ctzll(v);
@@ -766,7 +766,7 @@  static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
  * @return
  *     The last (most-significant) bit set, or 0 if the input is 0.
  */
-static inline int
+static inline uint32_t
 rte_fls_u64(uint64_t x)
 {
 	return (x == 0) ? 0 : 64 - __builtin_clzll(x);