DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dharmik Thakkar <dharmik.thakkar@arm.com>
To: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Cc: dev@dpdk.org, Dharmik Thakkar <dharmik.thakkar@arm.com>
Subject: [dpdk-dev] [PATCH v2 2/7] net/cxgbe: remove 'typedef int bool'
Date: Thu,  2 Jan 2020 17:48:33 +0000	[thread overview]
Message-ID: <20200102174838.12908-3-dharmik.thakkar@arm.com> (raw)
In-Reply-To: <20200102174838.12908-1-dharmik.thakkar@arm.com>

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/cxgbe/cxgbe_compat.h |  4 +---
 drivers/net/cxgbe/cxgbe_main.c   | 13 +++++++------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_compat.h b/drivers/net/cxgbe/cxgbe_compat.h
index 20e4f8af20ee..83ae1c2e5a83 100644
--- a/drivers/net/cxgbe/cxgbe_compat.h
+++ b/drivers/net/cxgbe/cxgbe_compat.h
@@ -10,6 +10,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdbool.h>
 
 #include <rte_common.h>
 #include <rte_memcpy.h>
@@ -86,7 +87,6 @@ typedef uint16_t  u16;
 typedef uint32_t  u32;
 typedef int32_t   s32;
 typedef uint64_t  u64;
-typedef int       bool;
 typedef uint64_t  dma_addr_t;
 
 #ifndef __le16
@@ -122,8 +122,6 @@ typedef uint64_t  dma_addr_t;
 
 #define FALSE	0
 #define TRUE	1
-#define false	0
-#define true	1
 
 #ifndef min
 #define min(a, b) RTE_MIN(a, b)
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index cc5f4df3acbf..0d0827c0e159 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -709,11 +709,12 @@ static int cxgbe_get_devargs(struct rte_devargs *devargs, const char *key,
 	return ret;
 }
 
-static void cxgbe_get_devargs_int(struct adapter *adap, int *dst,
-				  const char *key, int default_value)
+static void cxgbe_get_devargs_int(struct adapter *adap, bool *dst,
+				  const char *key, bool default_value)
 {
 	struct rte_pci_device *pdev = adap->pdev;
-	int ret, devarg_value = default_value;
+	int ret;
+	bool devarg_value = default_value;
 
 	*dst = default_value;
 	if (!pdev)
@@ -729,11 +730,11 @@ static void cxgbe_get_devargs_int(struct adapter *adap, int *dst,
 void cxgbe_process_devargs(struct adapter *adap)
 {
 	cxgbe_get_devargs_int(adap, &adap->devargs.keep_ovlan,
-			      CXGBE_DEVARG_CMN_KEEP_OVLAN, 0);
+			      CXGBE_DEVARG_CMN_KEEP_OVLAN, false);
 	cxgbe_get_devargs_int(adap, &adap->devargs.tx_mode_latency,
-			      CXGBE_DEVARG_CMN_TX_MODE_LATENCY, 0);
+			      CXGBE_DEVARG_CMN_TX_MODE_LATENCY, false);
 	cxgbe_get_devargs_int(adap, &adap->devargs.force_link_up,
-			      CXGBE_DEVARG_VF_FORCE_LINK_UP, 0);
+			      CXGBE_DEVARG_VF_FORCE_LINK_UP, false);
 }
 
 static void configure_vlan_types(struct adapter *adapter)
-- 
2.17.1


  parent reply	other threads:[~2020-01-02 17:49 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   ` Dharmik Thakkar [this message]
2020-01-02 17:48   ` [dpdk-dev] [PATCH v2 3/7] net/vmxnet3: remove 'typedef int bool' 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
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=20200102174838.12908-3-dharmik.thakkar@arm.com \
    --to=dharmik.thakkar@arm.com \
    --cc=dev@dpdk.org \
    --cc=rahul.lakkireddy@chelsio.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).