From 597cb1874068054d4c0be41f161a72ef37888930 Mon Sep 17 00:00:00 2001 From: Christian Ehrhardt Date: Tue, 26 Feb 2019 09:17:37 +0100 Subject: New upstream version 17.11.5 Change-Id: I8d2aa1aee2a9a78614dff5a01008f91e88e810c7 Signed-off-by: Christian Ehrhardt --- lib/librte_sched/rte_reciprocal.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'lib/librte_sched/rte_reciprocal.c') diff --git a/lib/librte_sched/rte_reciprocal.c b/lib/librte_sched/rte_reciprocal.c index 652f0237..385109cd 100644 --- a/lib/librte_sched/rte_reciprocal.c +++ b/lib/librte_sched/rte_reciprocal.c @@ -38,28 +38,13 @@ #include "rte_reciprocal.h" -/* find largest set bit. - * portable and slow but does not matter for this usage. - */ -static inline int fls(uint32_t x) -{ - int b; - - for (b = 31; b >= 0; --b) { - if (x & (1u << b)) - return b + 1; - } - - return 0; -} - struct rte_reciprocal rte_reciprocal_value(uint32_t d) { struct rte_reciprocal R; uint64_t m; int l; - l = fls(d - 1); + l = rte_fls_u32(d - 1); m = ((1ULL << 32) * ((1ULL << l) - d)); m /= d; -- cgit 1.2.3-korg