From patchwork Mon Apr 20 06:26:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 68932 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 37BD5A0561; Mon, 20 Apr 2020 08:28:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA4AA1D54A; Mon, 20 Apr 2020 08:26:48 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 6B5111D543 for ; Mon, 20 Apr 2020 08:26:46 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id BF7BB30C0DD; Sun, 19 Apr 2020 23:15:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com BF7BB30C0DD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1587363311; bh=yzHl1pbduBoR7Kh2wm4fMkuW3O2D31ZCALCX6UEakc8=; h=From:To:Cc:Subject:Date:From; b=kRVXp+BlbfCvOczlpqLuUXPpF7ctIvs8n9d+07TR4RhRYJjjdQGXpl6gGN7pP37v3 EVoKe1KkBg8Au/zI3axnuUYWEVsEzTiIxo5LB0HK3DYjlxEjoIrmw5e4J6+VXX/ax9 Yc59ANd73CEI77nQj5r5WKnVao5KpM6cYcS/0vUU= Received: from localhost.localdomain (unknown [10.230.2.19]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id F1429140069; Sun, 19 Apr 2020 23:26:40 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Raslan Darawsheh , Lance Richardson , Somnath Kotur Date: Sun, 19 Apr 2020 23:26:38 -0700 Message-Id: <20200420062638.80181-1-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] net/bnxt: fix CLANG compilation error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Suggested-by: Lance Richardson Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- 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