From patchwork Thu Jan 2 17:48:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dharmik Thakkar X-Patchwork-Id: 64168 X-Patchwork-Delegate: ferruh.yigit@amd.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 D9370A04F3; Thu, 2 Jan 2020 18:49:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A11121C199; Thu, 2 Jan 2020 18:49:19 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id A1A7F1C193 for ; Thu, 2 Jan 2020 18:49:16 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 080DEDA7; Thu, 2 Jan 2020 09:49:16 -0800 (PST) Received: from dp6132.usa.Arm.com (dp6132.usa.arm.com [10.118.91.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EDA773F703; Thu, 2 Jan 2020 09:49:15 -0800 (PST) From: Dharmik Thakkar To: Wenzhuo Lu , Konstantin Ananyev Cc: dev@dpdk.org, Dharmik Thakkar Date: Thu, 2 Jan 2020 17:48:32 +0000 Message-Id: <20200102174838.12908-2-dharmik.thakkar@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200102174838.12908-1-dharmik.thakkar@arm.com> References: <20191003224419.23968-1-dharmik.thakkar@arm.com> <20200102174838.12908-1-dharmik.thakkar@arm.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/7] 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" Compilation issue arises due to multiple definitions of 'bool' in 'ixgbe_ethdev.h'. 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: Phil Yang Reviewed-by: Gavin Hu --- 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 2c6fd0f13128..6cbd783e3a21 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2544,7 +2544,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; @@ -3993,7 +3994,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); @@ -4124,7 +4125,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; u32 esdp_reg;