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 F33F5A04F3; Thu, 2 Jan 2020 18:49:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F07DC1C1B1; Thu, 2 Jan 2020 18:49:24 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 25A4B1C194 for ; Thu, 2 Jan 2020 18:49:17 +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 74F2911FB; 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 6FF7C3F703; Thu, 2 Jan 2020 09:49:16 -0800 (PST) From: Dharmik Thakkar To: Qi Zhang , Xiao Wang Cc: dev@dpdk.org, Dharmik Thakkar Date: Thu, 2 Jan 2020 17:48:37 +0000 Message-Id: <20200102174838.12908-7-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> Subject: [dpdk-dev] [PATCH v2 6/7] net/fm10k: remove 'typedef int 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" Replace 'typedef int bool' with 'stdbool.h' to avoid possible multiple definitions of 'bool'. Signed-off-by: Dharmik Thakkar Reviewed-by: Phil Yang Reviewed-by: Ruifeng Wang --- drivers/net/fm10k/base/fm10k_osdep.h | 8 +------- drivers/net/fm10k/fm10k_ethdev.c | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/fm10k/base/fm10k_osdep.h b/drivers/net/fm10k/base/fm10k_osdep.h index 3b6298010da5..019fba5e2534 100644 --- a/drivers/net/fm10k/base/fm10k_osdep.h +++ b/drivers/net/fm10k/base/fm10k_osdep.h @@ -6,6 +6,7 @@ #define _FM10K_OSDEP_H_ #include +#include #include #include #include @@ -32,12 +33,6 @@ #define FALSE 0 #define TRUE 1 -#ifndef false -#define false FALSE -#endif -#ifndef true -#define true TRUE -#endif typedef uint8_t u8; typedef int8_t s8; @@ -47,7 +42,6 @@ typedef uint32_t u32; typedef int32_t s32; typedef int64_t s64; typedef uint64_t u64; -typedef int bool; #ifndef __le16 #define __le16 u16 diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 407baa16c364..581c690b1842 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -3210,19 +3210,19 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) /* Make sure Switch Manager is ready before going forward. */ if (hw->mac.type == fm10k_mac_pf) { - int switch_ready = 0; + bool switch_ready = false; for (i = 0; i < MAX_QUERY_SWITCH_STATE_TIMES; i++) { fm10k_mbx_lock(hw); hw->mac.ops.get_host_state(hw, &switch_ready); fm10k_mbx_unlock(hw); - if (switch_ready) + if (switch_ready == true) break; /* Delay some time to acquire async LPORT_MAP info. */ rte_delay_us(WAIT_SWITCH_MSG_US); } - if (switch_ready == 0) { + if (switch_ready == false) { PMD_INIT_LOG(ERR, "switch is not ready"); return -1; } -- 2.17.1