DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] eal: fix build issue
@ 2018-11-06 11:45 Jerin Jacob
  2018-11-06 12:29 ` Thomas Monjalon
  2018-11-07  6:59 ` [dpdk-dev] [PATCH v2 1/2] eal: introduce rte version of fls Jerin Jacob
  0 siblings, 2 replies; 11+ messages in thread
From: Jerin Jacob @ 2018-11-06 11:45 UTC (permalink / raw)
  To: dev; +Cc: thomas, Jacob,  Jerin, stable

Some toolchain has fls() definition in string.h as argument type int,
which is conflicting uint32_t argument type.

/export/dpdk.org/lib/librte_eal/common/rte_reciprocal.c:47:19:
error: conflicting types for ‘fls’
 static inline int fls(uint32_t x)
                  ^~~

/opt/marvell-tools-201/aarch64-marvell-elf/include/strings.h:59:6:
note: previous declaration of ‘fls’ was here
 int  fls(int) __pure2;

FreeBSD string.h also has fls() with argument as int type.
https://www.freebsd.org/cgi/man.cgi?query=fls&sektion=3

Fixing the conflict by renaming internal function as __fls

Fixes: ffe3ec811ef5 ("sched: introduce reciprocal divide")
Cc: stable@dpdk.org

Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 lib/librte_eal/common/rte_reciprocal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/rte_reciprocal.c b/lib/librte_eal/common/rte_reciprocal.c
index d81b11db6..f2c7453d2 100644
--- a/lib/librte_eal/common/rte_reciprocal.c
+++ b/lib/librte_eal/common/rte_reciprocal.c
@@ -44,7 +44,7 @@
 /* find largest set bit.
  * portable and slow but does not matter for this usage.
  */
-static inline int fls(uint32_t x)
+static inline int __fls(uint32_t x)
 {
 	int b;
 
@@ -62,7 +62,7 @@ struct rte_reciprocal rte_reciprocal_value(uint32_t d)
 	uint64_t m;
 	int l;
 
-	l = fls(d - 1);
+	l = __fls(d - 1);
 	m = ((1ULL << 32) * ((1ULL << l) - d));
 	m /= d;
 
-- 
2.19.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-11-12 12:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-06 11:45 [dpdk-dev] [PATCH] eal: fix build issue Jerin Jacob
2018-11-06 12:29 ` Thomas Monjalon
2018-11-06 13:31   ` Jerin Jacob
2018-11-06 20:27     ` Thomas Monjalon
2018-11-07  6:59 ` [dpdk-dev] [PATCH v2 1/2] eal: introduce rte version of fls Jerin Jacob
2018-11-07  6:59   ` [dpdk-dev] [PATCH v2 2/2] eal: fix build issue Jerin Jacob
2018-11-12  1:37     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
2018-11-12  4:50       ` Jerin Jacob
2018-11-12  9:01         ` Ferruh Yigit
2018-11-12  9:17           ` Thomas Monjalon
2018-11-12 12:28     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).