From: "Wang, Xiao W" <xiao.w.wang@intel.com>
To: Dharmik Thakkar <dharmik.thakkar@arm.com>,
"Zhang, Qi Z" <qi.z.zhang@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v2 6/7] net/fm10k: remove 'typedef int bool'
Date: Fri, 3 Jan 2020 01:34:36 +0000 [thread overview]
Message-ID: <B7F2E978279D1D49A3034B7786DACF407B05927E@SHSMSX106.ccr.corp.intel.com> (raw)
In-Reply-To: <20200102174838.12908-7-dharmik.thakkar@arm.com>
Hi,
> -----Original Message-----
> From: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Sent: Friday, January 3, 2020 1:49 AM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Wang, Xiao W
> <xiao.w.wang@intel.com>
> Cc: dev@dpdk.org; Dharmik Thakkar <dharmik.thakkar@arm.com>
> Subject: [PATCH v2 6/7] net/fm10k: remove 'typedef int bool'
>
> Replace 'typedef int bool' with 'stdbool.h' to avoid possible
> multiple definitions of 'bool'.
>
> Signed-off-by: Dharmik Thakkar <dharmik.thakkar@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> ---
> 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 <stdint.h>
> +#include <stdbool.h>
> #include <string.h>
> #include <rte_atomic.h>
> #include <rte_byteorder.h>
> @@ -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
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
BRs,
Xiao
next prev parent reply other threads:[~2020-01-03 1:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-03 22:44 [dpdk-dev] [PATCH] net/ixgbe: avoid multpile definitions of 'bool' Dharmik Thakkar
2019-10-16 6:23 ` Ye Xiaolong
2019-10-16 16:22 ` Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 0/7] remove 'typedef int bool' Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 1/7] net/ixgbe: avoid multpile definitions of 'bool' Dharmik Thakkar
2020-01-10 9:22 ` Ferruh Yigit
2020-01-10 20:55 ` Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 2/7] net/cxgbe: remove 'typedef int bool' Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 3/7] net/vmxnet3: " Dharmik Thakkar
2020-01-02 19:53 ` Yong Wang
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 4/7] net/bnx2x: " Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 5/7] net/e1000: " Dharmik Thakkar
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 6/7] net/fm10k: " Dharmik Thakkar
2020-01-03 1:34 ` Wang, Xiao W [this message]
2020-01-02 17:48 ` [dpdk-dev] [PATCH v2 7/7] net/qede: " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 0/7] " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 1/7] net/ixgbe: avoid multpile definitions of 'bool' Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 2/7] net/cxgbe: remove 'typedef int bool' Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 3/7] net/vmxnet3: " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 4/7] net/bnx2x: " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 5/7] net/e1000: " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 6/7] net/fm10k: " Dharmik Thakkar
2020-01-10 20:51 ` [dpdk-dev] [PATCH v3 7/7] net/qede: " Dharmik Thakkar
2020-01-13 11:14 ` [dpdk-dev] [PATCH v3 0/7] " 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=B7F2E978279D1D49A3034B7786DACF407B05927E@SHSMSX106.ccr.corp.intel.com \
--to=xiao.w.wang@intel.com \
--cc=dev@dpdk.org \
--cc=dharmik.thakkar@arm.com \
--cc=qi.z.zhang@intel.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).