[v3,6/7] net/fm10k: remove 'typedef int bool'
Checks
Commit Message
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 | 8 +-------
drivers/net/fm10k/fm10k_ethdev.c | 6 +++---
2 files changed, 4 insertions(+), 10 deletions(-)
@@ -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
@@ -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;
}