DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: Raslan Darawsheh <rasland@mellanox.com>,
	Lance Richardson <lance.richardson@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-dev] [PATCH] net/bnxt: fix CLANG compilation error
Date: Sun, 19 Apr 2020 23:26:38 -0700	[thread overview]
Message-ID: <20200420062638.80181-1-ajit.khaparde@broadcom.com> (raw)

Fix a compilation error seen with CLANG.
The current code causes a typedef redefinition error because
'p__LINE__' is a C11 feature. Fixing it by defining it to something
which is not already defined in the language.

Fixes: 3ca9012a81f9 ("net/bnxt: add initial TruFlow core session open")

Reported-by: Raslan Darawsheh <rasland@mellanox.com>
Suggested-by: Lance Richardson <lance.richardson@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/tf_core/hwrm_tf.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bnxt/tf_core/hwrm_tf.h b/drivers/net/bnxt/tf_core/hwrm_tf.h
index 2598ca7ee..6299d588a 100644
--- a/drivers/net/bnxt/tf_core/hwrm_tf.h
+++ b/drivers/net/bnxt/tf_core/hwrm_tf.h
@@ -37,7 +37,11 @@ typedef enum tf_subtype {
 #define TF_MAX_REQ_SIZE 104
 /* u32_t	tlv_resp_value[170]; */
 #define TF_MAX_RESP_SIZE 680
-#define BUILD_BUG_ON(condition) typedef char p__LINE__[(condition) ? 1 : -1]
+
+#define __BUILD_BUG_ON(condition, line) \
+	char p##line[(condition) ? 1 : -1]
+#define _BUILD_BUG_ON(condition, line) __BUILD_BUG_ON(condition, line)
+#define BUILD_BUG_ON(condition) _BUILD_BUG_ON(condition, __LINE__)
 
 /* Use this to allocate/free any kind of
  * indexes over HWRM and fill the parms pointer
-- 
2.21.1 (Apple Git-122.3)


             reply	other threads:[~2020-04-20  6:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20  6:26 Ajit Khaparde [this message]
2020-04-20  7:14 ` David Marchand
2020-04-20 12:22   ` Ferruh Yigit
2020-04-20 12:23     ` David Marchand
2020-04-20 12:49       ` Ferruh Yigit

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=20200420062638.80181-1-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=lance.richardson@broadcom.com \
    --cc=rasland@mellanox.com \
    --cc=somnath.kotur@broadcom.com \
    /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).