net/ixgbe: avoid multiple definitions of bool
authorDharmik Thakkar <dharmik.thakkar@arm.com>
Fri, 10 Jan 2020 20:51:46 +0000 (14:51 -0600)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:02 +0000 (19:46 +0100)
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 <dharmik.thakkar@arm.com>
Reviewed-by: Phil Yang <phil.yang@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ixgbe/base/ixgbe_osdep.h
drivers/net/ixgbe/ixgbe_ethdev.c

index ea8dc1c..844d170 100644 (file)
@@ -9,6 +9,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdbool.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_cycles.h>
@@ -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()
index b2f723f..e335187 100644 (file)
@@ -2545,7 +2545,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 = false, negotiate = 0;
        uint32_t speed = 0;
        uint32_t allowed_speeds = 0;
        int mask = 0;
@@ -3992,7 +3993,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);
@@ -4129,7 +4130,8 @@ ixgbe_wait_for_link_up(struct ixgbe_hw *hw)
 #else
        const int nb_iter = 0;
 #endif
-       int err, i, link_up = 0;
+       int err, i;
+       bool link_up = false;
        uint32_t speed = 0;
 
        for (i = 0; i < nb_iter; i++) {
@@ -4153,7 +4155,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;