net/fm10k: remove local bool type
authorDharmik Thakkar <dharmik.thakkar@arm.com>
Fri, 10 Jan 2020 20:51:51 +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>
Acked-by: Xiao Wang <xiao.w.wang@intel.com>
drivers/net/fm10k/base/fm10k_osdep.h
drivers/net/fm10k/fm10k_ethdev.c

index 3b62980..019fba5 100644 (file)
@@ -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>
 
 #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
index 407baa1..581c690 100644 (file)
@@ -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;
                }