DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	"Jacob,  Jerin" <Jerin.JacobKollanukkaran@cavium.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: [dpdk-dev]  [PATCH] eal: fix build issue
Date: Tue, 6 Nov 2018 11:45:01 +0000	[thread overview]
Message-ID: <20181106114435.14770-1-jerin.jacob@caviumnetworks.com> (raw)

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


             reply	other threads:[~2018-11-06 11:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 11:45 Jerin Jacob [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181106114435.14770-1-jerin.jacob@caviumnetworks.com \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=Jerin.JacobKollanukkaran@cavium.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).