net/cxgbe: remove local bool type
authorDharmik Thakkar <dharmik.thakkar@arm.com>
Fri, 10 Jan 2020 20:51:47 +0000 (14:51 -0600)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:02 +0000 (19:46 +0100)
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>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/cxgbe/cxgbe_compat.h
drivers/net/cxgbe/cxgbe_main.c

index 20e4f8a..83ae1c2 100644 (file)
@@ -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)
index cc5f4df..0d0827c 100644 (file)
@@ -709,11 +709,12 @@ out:
        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)