From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 21D50A3168 for ; Wed, 16 Oct 2019 08:26:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB5671E8B9; Wed, 16 Oct 2019 08:26:03 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 2F3601E8B7 for ; Wed, 16 Oct 2019 08:26:01 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Oct 2019 23:26:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,302,1566889200"; d="scan'208";a="194743218" Received: from yexl-server.sh.intel.com (HELO localhost) ([10.67.117.17]) by fmsmga008.fm.intel.com with ESMTP; 15 Oct 2019 23:25:59 -0700 Date: Wed, 16 Oct 2019 14:23:17 +0800 From: Ye Xiaolong To: Dharmik Thakkar Cc: Wenzhuo Lu , Konstantin Ananyev , dev@dpdk.org, stephen@networkplumber.org, honnappa.nagarahalli@arm.com Message-ID: <20191016062317.GN3725@intel.com> References: <20191003224419.23968-1-dharmik.thakkar@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191003224419.23968-1-dharmik.thakkar@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: avoid multpile definitions of 'bool' 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" Hi, On 10/03, Dharmik Thakkar wrote: >Compilation issue arises due to multiple definitions of 'bool' >in 'ixgbe_ethdev.h'. Which compiler would trigger this compilation issue? And we have several "typedef int bool" in multiple drivers, drivers/net/bnx2x/bnx2x_ethdev.h:50:typedef int bool; drivers/net/cxgbe/cxgbe_compat.h:89:typedef int bool; drivers/net/e1000/base/e1000_osdep.h:61:typedef int bool; drivers/net/fm10k/base/fm10k_osdep.h:50:typedef int bool; drivers/net/ixgbe/base/ixgbe_osdep.h:86:typedef int bool; drivers/net/qede/base/bcm_osal.h:74:typedef int bool; drivers/net/vmxnet3/base/vmxnet3_osdep.h:12:typedef int bool; Do you need to change them all? Thanks, Xiaolong > >Error: >'/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c: In function >‘ixgbe_dev_setup_link_alarm_handler’: >/dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:4075:43: >error: passing argument 3 of ‘ixgbe_get_link_capabilities’ from >incompatible pointer type [-Werror=incompatible-pointer-types] > ixgbe_get_link_capabilities(hw, &speed, &autoneg); > ^ >In file included from /dpdk/drivers/net/ixgbe/ixgbe_ethdev.c:41:0: >/dpdk/drivers/net/ixgbe/base/ixgbe_api.h:63:5: note: expected >‘bool * {aka int *}’ but argument is of type ‘_Bool *’' > >Signed-off-by: Dharmik Thakkar >Reviewed-by: Honnappa Nagarahalli >--- > drivers/net/ixgbe/base/ixgbe_osdep.h | 4 +--- > drivers/net/ixgbe/ixgbe_ethdev.c | 7 ++++--- > 2 files changed, 5 insertions(+), 6 deletions(-) > >diff --git a/drivers/net/ixgbe/base/ixgbe_osdep.h b/drivers/net/ixgbe/base/ixgbe_osdep.h >index ea8dc1cbe570..844d1701f595 100644 >--- a/drivers/net/ixgbe/base/ixgbe_osdep.h >+++ b/drivers/net/ixgbe/base/ixgbe_osdep.h >@@ -9,6 +9,7 @@ > #include > #include > #include >+#include > #include > #include > #include >@@ -82,9 +83,6 @@ typedef int16_t s16; > typedef uint32_t u32; > typedef int32_t s32; > typedef uint64_t u64; >-#ifndef __cplusplus >-typedef int bool; >-#endif > > #define mb() rte_mb() > #define wmb() rte_wmb() >diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c >index 7eb3d0567b58..2c5d2e5f9295 100644 >--- a/drivers/net/ixgbe/ixgbe_ethdev.c >+++ b/drivers/net/ixgbe/ixgbe_ethdev.c >@@ -2589,7 +2589,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev) > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > uint32_t intr_vector = 0; >- int err, link_up = 0, negotiate = 0; >+ int err; >+ bool link_up = 0, negotiate = 0; > uint32_t speed = 0; > uint32_t allowed_speeds = 0; > int mask = 0; >@@ -3958,7 +3959,7 @@ ixgbevf_dev_info_get(struct rte_eth_dev *dev, > > static int > ixgbevf_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed, >- int *link_up, int wait_to_complete) >+ bool *link_up, int wait_to_complete) > { > struct ixgbe_adapter *adapter = container_of(hw, > struct ixgbe_adapter, hw); >@@ -4089,7 +4090,7 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev, > ixgbe_link_speed link_speed = IXGBE_LINK_SPEED_UNKNOWN; > struct ixgbe_interrupt *intr = > IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); >- int link_up; >+ bool link_up; > int diag; > int wait = 1; > >-- >2.17.1 >